c# - how to get <a> tag inner html in javascript -


i doing online shopping. want tag's inner html in asp.net c#. tried lot of examples. tried through javascript also. cannot it. me!!

thanks in advance!

you want bind id anchor-tag , call so;

html

<a href="#" id="myatag">current text</a> 

javascript

var a_tag_1 = document.getelementbyid('myatag');  var a_tag_html = a_tag_1.innerhtml; 

you "can" call a-tags, it's recommended narrow down either id or selecting parent first , going down in there find a-tags. when so, can use;

document.getelementsbytagname('a'); //or my_var_element.getelementbytagname('a'); 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -