LoginSignup
4
4

More than 5 years have passed since last update.

$(selector).click()を$(document).on('click', selector...に置き換える正規表現

Posted at

jQuery。
今までずっと$('.aaa').click(function(){});とか使ってたけど、それが非推奨になって.on()になったので正規表現で一括置き換え。メモ。

置き換え元
\$\(['"](.+?)['"]\)\.(.+?) ?\( ?function ?\(([ ,A-Za-z0-9]*?)\) ?\{
置き換え先
\$(document).on('$2', '$1', function($3){
4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4