Reputation: 1
I have a variable that holds the following value -
$content = "<input value="" name="field" type="text">";
Using this variable in need to get the value of "value" attribute. How to get that ?
Upvotes: 0
Views: 96
Reputation: 3600
You can also do this:
$content = '<input value="" name="field" type="text">';//replace double quotes here with single quote
$(content).val();
Upvotes: 0
Reputation: 82231
Dom Should be.
$content = '<input value="" name="field" type="text">';
Try This:
$(content).attr("value")
Upvotes: 3