I have a date filter web part and a list web part in a page.

I want to get the value of date filter web part using javascript or jQuery. I am using the following code

<script type="text/javascript">
$(document).ready(function() {   
 var x=document.getElementById("ctl00_ctl41_g_ed4beb82_8f7e_4389_bb35_a44188462aab_DateFilterPicker_DateFilterPickerDate");

where ctl00_ctl41_g_ed4beb82_8f7e_4389_bb35_a44188462aab_DateFilterPicker_DateFilterPickerDate is the id of the date filter web part.

In alert box, it shows blank.

What changes has to be made to get the value of date filter web part?


@vikash As it is an input element of type text

you can get the value of it by using value property x.value

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.