jQuery replaceAll Method
home
Run
screen_rotation
fullscreen
cloud_download
<!DOCTYPE html> <html> <head> <title>jQuery Demo example</title> <script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.min.js"> </script> <script type="text/javascript"> $(document).ready(function(){ $( "#replaceExample" ).on( "click", function(event) { $("<div style='background:skyblue;padding:10px;'>Hi I Am New One.....</div>").replaceAll(".replaceAll"); }); }); </script> <style> div{ margin:10px; min-height:50px; min-width:100%; border:1px solid blue; float:left; } </style> </head> <body> <h4 ><a href="javascript:void(0);" id="replaceExample">Click to run .replaceAll() Example </a></h4> <div class="replaceAll" style="background:yellow;border:1px solid green;padding:0px;" > Old Div1.......... </div> <div class="replaceAll" style="background:yellow;border:1px solid green;padding:0px;" > Old Div2.......... </div> </body> </html>
<!DOCTYPE html> <html> <head> <title>jQuery Demo example</title> <script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.min.js"> </script> <script type="text/javascript"> $(document).ready(function(){ $( "#replaceExample" ).on( "click", function(event) { $("<div style='background:skyblue;padding:10px;'>Hi I Am New One.....</div>").replaceAll(".replaceAll"); }); }); </script> <style> div{ margin:10px; min-height:50px; min-width:100%; border:1px solid blue; float:left; } </style> </head> <body> <h4 ><a href="javascript:void(0);" id="replaceExample">Click to run .replaceAll() Example </a></h4> <div class="replaceAll" style="background:yellow;border:1px solid green;padding:0px;" > Old Div1.......... </div> <div class="replaceAll" style="background:yellow;border:1px solid green;padding:0px;" > Old Div2.......... </div> </body> </html>
Copyrights@tutorialsplane.com