Home >Web Front-end >JS Tutorial >JS method to obtain image lowsrc attribute_javascript skills
The example in this article describes the JS method of obtaining the lowsrc attribute of an image. Share it with everyone for your reference. The details are as follows:
The lowsrc attribute is generally set to the low-resolution image address of the image. The following code can display the low-resolution version of the image by clicking on the link
<!DOCTYPE html> <html> <body> <img id="compman" src="compman.gif" lowsrc="compman_lowres.gif" alt="Computerman" width="107" height="98"> <br> <script> var x=document.getElementById("compman"); document.write('<a href="' + x.lowsrc + '">Low resolution</a>'); </script> </body> </html>
I hope this article will be helpful to everyone’s JavaScript programming design.