Created
November 6, 2015 02:54
-
-
Save kruxor/ad26748fc60a871adecd to your computer and use it in GitHub Desktop.
Load content into a div with jQuery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="content">..</div> | |
<button onclick="$('#content').html(content);">click it</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var content = "<style>a { color:#000;font-weight:bold; }</style>\ | |
<a href='#'>a test link</a><br>\ | |
a new line if needed<br>\ | |
another new line."; | |
$('#content').html(content); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment