Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery equivalent for window.document.write

Does anyone know the jQuery equivalent for window.document.write('') in javascript? Thanks

like image 866
Thurein Avatar asked Mar 30 '11 17:03

Thurein


1 Answers

This will add the string "hello" right before the body closing tag. Not exactly the behavior of write, but you can do this to any element to get the content to appear where you want it.

$(document.body).append('hello');

Also available are prepend(content) and replaceWith(content) for all your insertion needs!

like image 163
ctcherry Avatar answered Oct 06 '22 12:10

ctcherry