I have the following variable which contains the following string. I would like to remove both the <nobr> and the </nobr> and just leave what is inside.
alert(product_code);
produces
<nobr>209/00254/01</nobr>
How would I make a new variable that removes the <nobr> tags?
var product_code = $(this).html();
alert(product_code);
If you wanted to just remove them completely (from the original), you can use
.replaceWith()for example:You can test it out here. Or,
$.trim()the.text()result (since they’ll be spaces in the result):