Grabbing span value
Grabbing span value
I have the following code, it's a custom drop down menu... I want to check that the value is not empty, how do I grab the value between the <span> tags?
I tried this but it no worky...
var storeType = $('store_type_list dt a span').html();
- <dl id="store_type_list" class="dropdown_store_type">
<dt>
<a>
<?php
if (isset($_SESSION['tmpStoreType'])) {
echo '<span>' . $_SESSION['tmpStoreType'] . '</span>';
}
else {
echo '<span></span>';
}
?>
</a>
</dt>
<dd>
<ul>
<li><a>501c Non-Profit<span class="value">non profit</span></a></li>
<li><a>Private Club<span class="value">private club</span></a></li>
<li><a>School Sports<span class="value">school sports</span></a></li>
</ul>
</dd>
</dl>