Get Value Of Inside A Tag With JQuery.?
How can by jQuery get value inside tag b? hi_1 hi_2 hi_3 hi_4 I want this
Solution 1:
Are you looking for something like this?
$(document).ready(function() {
var textArr = [];
$('span b').each(function() {
textArr.push($(this).text());
});
alert(textArr.join(', '));
});
Solution 2:
To get the value inside a specific HTML tag in jQuery you can use the text function. This combined with a selector gets the output you're looking for
$('span b').each(function() {
console.log($(this).text());
});
Solution 3:
This is cool
var x = $("span b").map(function() {
return $(this).text();
}).toArray().join(", ");
Post a Comment for "Get Value Of Inside A Tag With JQuery.?"