If I have something like:
<h1 id="someID">
<span id="genericID">someValue</span>
</h1>
How can I get the value of genericID span element, that is, someValue using the id ,someID, of the h1 element? I can get document.getElementById(‘oc-title-id’).innerHTMLand then do a regex, but is there any other way? Using JQuery or Javascript?
You can use
$('#someID').text()Or for javascript only
document.getElementById('someID').innerHTML