Dongzhi Yang7528784
Posts: 0
Joined: Mon May 11, 2015 6:28 am

How can I get the value of datepicker in JS?

Hi,
I am really new to appery and Jquery.
for example my datepicker name is "datepicker1" , how can I get the date value in JS?

Thanks

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

How can I get the value of datepicker in JS?

Hello Dongzhi,

Please use the following code
prevar value = $("[name=datepickerName] input").val();/pre
where datepickerName - datepicker name

Dongzhi Yang7528784
Posts: 0
Joined: Mon May 11, 2015 6:28 am

How can I get the value of datepicker in JS?

Thanks Evegene, it worked!

Just for my reference and correct me if I am wrong. I have found the following web link regarding jquery selector. So judging from the code you provide. "input" is a descendant of datepicker .

http://www.w3schools.com/jquery/jquer...

-[attribute=value] | $("[href='default.htm']") | All elements with a href attribute value equal to "default.htm"

-parent descendant | $("div p") | All elements that are descendants of a element


Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

How can I get the value of datepicker in JS?

Hello Dongzhi,

Sorry for delay. Yes, this is correct.

Return to “Issues”