I am trying to select the content inside of a div but the CMS I am using adds this span inside of my div and so now I am not sure how to select the content inside of it. That sp
Do this:
var emailAddress = null;
$(document).ready(function() {
emailAddress = $('#emailAddress span').text();
console.log(emailAddress);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="emailAddress"><span merge-tag="{{user.email}}">CONTENT HERE IS WHAT THE VARIABLE SHOULD BE SET TO</span></div>