Tag Archives: jquery Demo

Set the src attribute of the iframe element using jQuery

The following code snippet shows that how you can set the src attribute of the iframe element using jQuery. In the example set the src attribute of the iframe on the click of the submit button. <!DOCTYPE html> <html> <head> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script type="text/javascript"> $(function(){ $("#btnSubmit").click(function(){ $(‘#iframWelcome’).attr(‘src’, ‘welcome.html’); }); }); </script> </head> <body> <form> Enter … Continue reading Set the src attribute of the iframe element using jQuery