Home > front end >  A regular writing, thank you for your help
A regular writing, thank you for your help

Time:09-16

Pagecontent) innerHTML=pagecontent) innerHTML. Replace (/& lt; ([\/]? (div) ((:? \ s *) (:? [^ & gt;] (*) :? \ s *)) & gt;/g, '& lt; $1 span $3 & gt; ');

This is a all page div replace regular span, I want to put all the div and textarea, button is replaced with span everybody excuse me, how to change

CodePudding user response:

Sorry, wrong, is to put the div and textarea replace span and the button

CodePudding user response:

The replace (/& lt; (\/? Div ([^ & gt;] *) & gt;/g, "$1 span $2"). The replace (/& lt; (\/? The textarea ([^ & gt;] *) & gt;/g, "$$2" button)

CodePudding user response:

refer to the second floor chinaskysun response:
replace (/& lt; (\/? Div ([^ & gt;] *) & gt;/g, "$1 span $2"). The replace (/& lt; (\/? The textarea ([^ & gt;] *) & gt;/g, "$button $2")
hello, thanks for answer, as if there's no way, all messed up seems to be no end

CodePudding user response:

STR=STR. Replace (/div/g, "span"). The replace (/textarea/g, 'button)

CodePudding user response:


The replace (/& lt; Div> ([\ w \] D *) & lt; \/div>/, '& lt; Span> $1 & lt;/span> '). The replace (/& lt; Textarea (. *) & gt; ([\ w \] D *) & lt; \/textarea>/, '& lt; The button $1 & gt; $2 & lt;/button> ')
  • Related