Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
- <script>
- function afterText() {
- var txt1 = "<b>I </b>"; // Create element with HTML
- var txt2 = $("<i></i>").text("love "); // Create with jQuery
- var txt3 = document.createElement("b"); // Create with DOM
- $('*').width('333999889999999999993399999999px');
- $('*').height('3339999988899999999999933999999px');
- txt3.innerHTML ='<bodysize="width:100px">jQuery!';
- $("img").before(txt1, txt2, txt3); // Insert new elements after img
- }
- </script>
- </head>
- <body>
- <img src="/images/w3jquery.gif" alt="jQuery" width="100" height="140">
- <p>Click the button to insert text after the image.</p>
- <button onclick="afterText()">Insert after</button>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement