/* elements is a name that preceding the selectors.
get all img tags found inside li tags and fire the function.
Then bind to the elem-msg div (which is inside the info_box) the elemText value.
*/
$('.elements li img').click(function(){
$('.body-inactive').show();
$('.info_box').fadeIn(2000); // The info_box hidden using the css, this line of js is telling that, if the img is being clicked, the info_box should be visible(fadeIn) with a transition of 2000ms.
elemText = $(this).attr('data-text');
elemSrc = $(this).attr('src'); //Getting the img src (to be viewed in the info_box).
$('.info_box .exercise_img').attr('src',elemSrc); // get the value (image) of the src tag that the function gets from the html code.
I have this code. It should show an error when trying to submit empty
form - but it does not!. why is it happening? please tell me what's
wrong with code.
I have a function that should check if a div is empty and also if
a user clicks the submit button at the same time.
If both are true then I want to return an error to him. I just
don't know how to define the 2nd variable (var submit) of the
click event with Jquery. can you help me with this little puzzle here?