Created
November 11, 2014 21:22
-
-
Save csdear/c40a93bbcf489b5fabac to your computer and use it in GitHub Desktop.
jQuery : Injecting 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
p { | |
color: blue; | |
margin: 8px; | |
} | |
b { | |
color: red; | |
} |
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
<title>text demo</title> | |
<body> | |
<p>The Source div's html content : </p> | |
<div id="source"><p>...From one element to another...</p></div> | |
<br /> | |
<br /> | |
<br /> | |
<br /> | |
<p>The Destination div : </p> | |
<div id="destination"><p></p></div> | |
<p></p> | |
</body> |
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 str = $("#source").text(); | |
$("#destination").html(str); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment