Click here to Skip to main content
15,893,161 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hii.
how can i acces imageurl in javascript?
pls help
Posted

This is very simple.
Try this,

imgControlId.src
 
Share this answer
 
//With the help of a little JQuery

If you are using the Image Asp.net server control, you should use:

var url = $("#<%=ImgCtrl.ClientID%>").attr("src");


Assuming the Image control's ID is ImgCtrl

Or, if the image is simply an HTML element,

var url = $("#imgid").attr("src");


Assuming the id of the image is "imgid"
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900