How to operate on custom HTML with jQuery? -


let's have

str = "hello, <b>my name is</b> jquery."; 

and want use $ selector, "my name is". should do? far tried this:

html = $.parsehtml( str ); $( $(html), "b") 

without success...

it returns array of elements, not chosen element...

edit: cannot modify str.

try solve regexp

var str = "hello, <b class='needsthing'>my name is</b> jquery."; var reg = new regexp(/<b>.*<\/b>/) result = str.match(reg) 

is it, u want?


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -