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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -