Reputation: 155
I'm trying to get the value of this label:
<label id="name" class="sub_heading"><?php echo $_SESSION['lastname'].", ".$_SESSION['firstname']; ?></label>
for some reason this:
var name = ("#name").val();
is not working?
Upvotes: 1
Views: 84
Reputation: 191729
Per documentation, .val()
should be used only on form controls (input
, button
, select
, textarea
). If you want the contents of an element, use .text()
or .html()
as appropriate.
Upvotes: 0