I change one div block to another with the following script
$(document).ready(function(){ var result = $("#main_text"); $(result).click(function(){ $(result).remove(); $( "body" ).append( "<div id='work'>Π½Π΅ΠΊΠΎΡΠΎΡΡΠΉ ΡΠ΅ΠΊΡΡ</div>" ); }); }); Everything works fine, but then I want to change the work block created by the previous script with a click of the mouse to another one, I try to change it with the same code
$(document).ready(function(){ var result = $("#work"); $(result).click(function(){ $(result).remove(); $( "body" ).append( "<div id='newwork'>Π½Π΅ΠΊΠΎΡΠΎΡΡΠΉ ΡΠ΅ΠΊΡΡ2</div>" ); }); }); but nothing works, tell me how to change the div blocks several times at the click of a mouse using javascript?
html:
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Besha's site</title> <meta name="description" content="The HTML5 Herald"> <meta name="Besha" content="SitePoint"> <link rel="stylesheet" href="css/styles.css"> <link rel="stylesheet" href="css/animate.css" /> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script type="text/javascript" src="js/jquery.textillate.js"></script> <script type="text/javascript" src="js/jquery.lettering.js"></script> <script type="text/javascript" src="js/script.js"></script> <link rel="shortcut icon" href="http://besha.rudev.org/favicon.ico" type="image/x-icon"> <link rel="icon" href="http://besha.rudev.org/favicon.ico" type="image/x-icon"> </head> <body> <div id="spider"> <img src="http://besha.rudev.org/img/spider.png"> </div> <div id="spidereye"> <img src="http://besha.rudev.org/img/spaidereye.png"> </div> <div id="main_text"> <h1 id="tlt"> <p data-out-effect="fadeOut" data-out-shuffle="true">Coming soon...</p> </h1> </div> </body> </html>