Under JQM, how can i get the text inside SPANs?
As i searched, there are hundreds of method to do that.
But nothing available on my case.
I want display those SPAN value as 123 – 456 on section “mainPage”.
<script>
$('a[name=submit_button]').click(function(){
var Val1 = $('#zip1').text(text);
var Val2 = $('#zip2').text(text);
...
</script>
<section id="mainPage" data-role="page">
...
</section>
<section id="zipSearch" data-role="dialog" data-theme="d">
...
<ul><li><a name="sumit_button href="#mainPage"><span id="zip1">123</span><span id="zip2">456</span></li>
</ul>
...
</section>
Simply use
It probably doesn’t work for you because you have syntax error in your a tag (forgot one of “). Change it to:
EDIT: I have also just noticed you haven’t closed your a tag either. Clear up your HTML tags, spooky things happen when you your strings or tags aren’t terminated in the right place 🙂