Posts

Showing posts with the label jquery interview questions

uncheck radio button on second click jquery

<div class="col-md-3">   <div class="form-group" >     <label for=" " class="ProLabel1">Stage</label>     <div class="ProInput1">       <input type="radio" onclick="preshow()" name="prepost"    value="pre" >Pre Chargesheet       <input  type="radio" onclick="postshow()" name="prepost" value="post">Post Chargesheet     </div>   </div> </div> <script> $(function(){     $('input[name="prepost"]').click(function(){         var $radio = $(this);         // if this was previously checked         if ($radio.data('waschecked') == true)         {             $radio.prop('checked', false);             $radio.data('waschecked', false);         }   ...

How to focus on a particular input box on page load using Jquery?

To focus on first input box $(function(){ $("input")[0].focus(); }); To focus on second input box $(function(){ $("input")[3].focus(); }); To focus on a particular id of input box $(function(){ $("id1")[0].focus(); });

What's the difference between 'mouseup', 'mousedown' and 'click' events?

Image
mostly guys confused in these events. So a coder must always clear about it. Mouup, mousedown and click event  are the different events. There is a basic difference as I mentioned and tried to clear it by diagram also.🔽🔽🔽 With a mouseup() event, you can click somewhere else on the screen, hold down the click button, and move the pointer to your mouseup element, and then release the mouse pointer. A click event requires the mousedown and mouseup event to happen on that element. The normal expectation is that a click requires both the mousedown and mouseup event , so I'd recommend the click event. I think this blog will help you to understand about mouseup, mousedown and click events. so if you like this blog then like it and subscribe to my blog also. Thankyou.