javascript - Get value of string between two <a> tags? -
i need take this:
<a href="mailto:email@email.com">email@email.com</a>
and have return
email@email.com
and i'm not quite sure how go doing this? i'm horrible regex i'm pretty sure need find ">
, comes between , </a>
i'm not sure how search thing between 2 other things.
edit: found regex need: .replace(/(<([^>]+)>)/ig,'')
strip tags away , give inner contents, solutions down below better way it. guys!
if single <a>
tag on html use,
document.getelementsbytagname("a")[0].innerhtml;
if there multiple <a>
tags try giving them ids
<a href="mailto:email@email.com" id="someid">email@email.com</a>
then in javascript:-
document.getelementbyid("someid").innerhtml;
Comments
Post a Comment