javascript - JQuery event dosen't work after .addClass -


why div#1 dosen't change text. i'm doing wrong?

<div id="1" class="a" style="width: 300px;height: 300px; background-color: #003366"></div> <div id="2" class="b" style="width: 300px;height: 300px; background-color: #003366"></div>  <script> $(document).ready(function(){     $(".b").click(function(){        $(this).text("hello");     });      $(".a").mouseover(function(){       $(this).addclass("b");     }); }); </script> 

try

$("body") .on('click', '.a', function (){    $(this).addclass("b"); }) .on('click', '.b', function (){     $(this).text("hello"); }) 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -