toggleClass in jQuery -


i cant toggleclass work, here's jsfiddle: http://jsfiddle.net/edddotcom/v6vhx/

clicking on image supposed make text change colour removing .mid class not doing @ moment.

here's javascript:

$(document).ready(function(){     $("#image").click(function(){         $("p").toggleclass(".mid");     }); }); 

and html

<div class="container">     <div class="row">         <p>hello</p>         <p class="mid">hello</p>         <img id="image" src="http://icons.iconarchive.com/icons/artua/mac/512/earth-icon.png"/>     </div>    </div> 

the css saying .mid class red text, if need see jsfiddle,

what missing/doing wrong?

with toggleclass, leading dot before class name not required.

$("p").toggleclass("mid"); 

Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -