This article mainly introduces how to change the src value of the embed label in js, and involves the javascript operation element attribute technique, which is of great practical value, for more information about how to change the src value of the embed label in js, see the following example. Share it with you for your reference. The specific analysis is as follows:
Today, we have a need for a bunch of videos, links, and links to open related videos on this page.
First, it's easy. Just change the src value to the href value you clicked on.
After trying, I found that this is not the case. How to put the video or how to put it? It will always be the one I just opened.
The second idea is to add a label to the embed, clear the content, and write it into it. This will always work.
I tried it. It is the same as above.
I tried many other similar methods, but I still cannot.
Finally, hide the embed label (display: none) and try again. Finally, you can!
The Code is as follows:
Var tabv = document. getElementById ("f_tabv"); var tabva = tabv. getElementsByTagName ("a"); var tabcv = document. getElementById ("f_tab_cv"); tabcv. innerHTML =''; For (var I = 0; I
'; Tabcv. getElementsByTagName ("embed") [0]. style. display = "none"; tabcv. innerHTML = ""; tabcv. innerHTML = href2; for (I = 0; I
I hope this article will help you design javascript programs.