Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript get content between tags

var str = "<b>Bob</b>, I'm <b>20</b> years old, I like <b>programming</b>.";

var result = str.match(/<b>(.*?)</b>/g).map(function(val){
   return val.replace(/</?b>/g,'');
});
//result -> ["Bob", "20", "programming"] 
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #content #tags
ADD COMMENT
Topic
Name
7+5 =