Sunday, 15 February 2015

javascript - VS 2013 find and replace document.getElementById("elementId").value with $("#elementId).val() -



javascript - VS 2013 find and replace document.getElementById("elementId").value with $("#elementId).val() -

i trying replace all

document.getelementbyid("elementid").value

with

$("#elementid").val()

where id of element varies.

what should find what , replace with syntax?

press ctrl+shift+f come in "find , replace" dialog. alter "replace in files" tab , tick checkbox "use regular expressions"

in "find what" textbox enter:

document\.getelementbyid\(\"(?<elem>\w+)\"\)\.value

and in "replace with" textbox enter:

$("#${elem}").val()

javascript jquery regex replace visual-studio-2013

No comments:

Post a Comment