<h2>This is a heading</h2> <p id="demo2">demo2: This is a paragraph.</p> <p id="demo3">demo3: This is another paragraph.</p> <button onclick="clickme()">hide demo1</button>
<script> function add_jquery() { var script= document.createElement('script'); script.type= 'text/javascript'; script.src= "http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"; // script.async = true; document.body.appendChild(script);
alert("이 버튼을 처음으로 눌렀을 때는, alert가 없으면 FF에서는 hide demo1이 동작되지 않는다.");
hide_demo("#demo1"); };
function run_jquery() { hide_demo("#demo2"); };
function myFunction() { hide_demo("#demo3"); };
function clickme() { hide_demo("#demo1"); };
function hide_demo(demo_id) { $(document).ready(function(){ $(demo_id).hide(); }); };