skip to Main Content

How to get id using Javascript?

How can I extract the text: mytr161 if what is known to me is this text: 8039089332 <tr bgcolor="#dcdcdc" id="mytr161"> <td align="right" bgcolor="#BDB9B4"><input type="checkbox" id="ck161" name="ck161" value="1" onclick="javascript:changebgcolor('161');"></td> <td align="center" nowrap=""><small><font size="2"> <a href="MfSchOpen850PODetail.asp?lpo=8039089332&amp;litem=hidingit&amp;Plant=hidingitaswell&amp;lsimplifyordertype=hidden" target="Podetail">8039089332</a> </font></small>&nbsp;</td> I have a list…

VIEW QUESTION

Javascript – How can I write the content of a variable in image src while using document.getElementById?

I have the following code document.write("<img src=./", i, ".png width='100px' height='100px'>"); document.write("<img src=./", x, ".png width='100px' height='100px'>"); document.write("<img src=./", y, ".png width='100px' height='100px'>");` and I want to use the src in getElementById(myImg).InnerHTML. I tried this document.getElementById("myImg").innerHTML.src = "./", i, ".png…

VIEW QUESTION
Back To Top
Search