I have this short piece of code that copies content from one div into another on the click of a button:
<a id="btn123">CLICK ME</a>
<div id="test1"></div>
<div id="test2">
<h1>Heading</h1>
</div>
$("#btn1").click(function(){
$('#test1').html($('#test2').contents());
});
This works fine here http://jsfiddle.net/9hnZx/ but when i put it into my website it will not function, anyone know why? Thanks
$is no longer aliased to the jQuery object.You’re explicitly including “jquery-noconflict.js”, the only contents of which is
jQuery.noConflict();. The explicit intention of this line is to to unalias$from jQuery.The following works: