I have a list written in HTML:
<p>
1 - hello
2 - yo
3 - sup
</p>
I want to replace the number [1-20] followed by the space[ ] followed by the hyphen[-] with "<p class='answer'>"using Jquery.
I believe it is something like this? (obviously inside the .find is just explaining what I am looking for):
$( "p" ).find( "#[1-20] -" ).replaceWith( ""<p class='answer'>"" );
pelement inside anotherpelement? That's an invalid markup.