Javascript Tip of the day
February 26, 2015
0

Javascript tip of the day

Hello folks,

I want to share with you my Javascript tip of the day. Have you ever wondered how to unselect a selected value in a dropdown lis using JQuery?

Really simple:

$("option:selected").prop("selected", false);

Nice uh?

Nice and simple! But wait, here is another Javascript tip of the day!

What about clearing a datepicker field? here it is!

$('#your_id').val("").datepicker('update');

This is wonderful and precious, since it took me a lot of time to figure it out!

Anyway that’s all for today!

Enjoy

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close