1. Picture switching
The modified image will be modified//h5//jsvar img = document.getElementById ("img") in IMG. Img.setattribute ("src", "img/2.jpg");
2.video played video to switch between images--failed
1. Follow the image switch, the modified video playback does not change//h5<video id= "video" width= "" "height=" "controls=" Controls "><source id=" Videoplaysrc "src=" Movie.mp4 "type=" Video/mp4 "></source></video>//jsdocument.getelementbyid" (" Videoplaysrc "). SetAttribute (" src "," 320x240.ogg ");d Ocument.getelementbyid (" Videoplaysrc "). SetAttribute (" type "," Video/ogg ");d Ocument.getelementbyid (" video "). Play ();
3.video Next Success
H%<video id= "video" width= "height=" "controls=" Controls "><source id=" videoplaysrc "src=" Movie.mp4 " Type= "Video/mp4" ></source></video>//js directly to the SRC assignment of video, you can change the videos to be played document.getElementById ("video" ). src= "320x240.ogg";
Summarize:
1.video played video is its own attribute in SRC, not its child elements in the first <source> content.
2.document gets to the label can directly modify the properties of the label, and timely feedback to the displayed page.
HTML5 switch playback of video, picture switch