title: How do I remove a script tag by its content and its src?
body: <p>I need to remove a script tag (<code>&lt;script&gt;...&lt;/script&gt;</code>) by its content and/or its src property. Taking as example this:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      var adfly_id = 2776246;
  &lt;/script&gt;
  
  &lt;script src="https://cdn.adf.ly/js/display.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>I've tried this code:</p>
  
  <pre><code>jQuery(document).ready(function($){
      $('script').each(function() {
          if (this.src === 'https://cdn.adf.ly/js/display.js') {
              $(this).remove();
          }
      });
  });
  </code></pre>
  
  <p>But without success (I am using that code from within WP - if anyone is asking why that jQuery syntax), can any give me some advice?</p>
  
  <p><strong>EDIT: The idea here is remove the script to prevent its execution</strong></p>