<button>button</button> <div>content</div> $(function(){ $("button").on("click", function(){ var _style = "<style>div { background: red;}</style>"; $("body").html($("body").html() + _style); }) })