javascript - Parse two HTML String with JS - and convert one to Int -
i'm parsing first string , works fine:
var links = document.getelementsbytagname("a"); var element; function search() { (var = 0; < links.length; i++) { element = links[i]; var cost = parseint(element); if (element.href.indexof("http://www.myurl.com") == 0) { //program goes here } } }
however, each of hyperlinks (products) has string cost on (in same div element). this:
<span class="price_table_value"> pricetag:<br> <span style="color:white">239,--€ </span> </span>
i love somehow parse , utilize parseint() create integer out of it.
i've thinking hr , cant find solution (im still origin larn js). help/ideas?
you can seek one...
function search() { (var = 0; < links.length; i++) { element = links[i]; var cost =parseint($(".price_table_value").value); }
}
javascript parsing
No comments:
Post a Comment