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
Post a Comment