tags:

views:

20

answers:

1

Hi Stackers :) I am trying to select the child input using by using selectors..I do not want to place an id or class onto the actual input element itself. Can somone tell me where i am going wrong?

Chris

<script type="text/javascript">
    $(function() {
        $(".ICS_MeetingSpaceHomeTableHeaderDateControl").children().datepicker();
    });
    </script>


<div class='ICS_MeetingSpaceHomeTableHeaderDateControl'>
  <input type='text' />
</div>
A: 

Are you sure you are including the jQuery UI javascript file and css file?

The code you have posted should work.

I would change the code to this to make sure you are only selecting input tags:

$(".ICS_MeetingSpaceHomeTableHeaderDateControl input:text").datepicker();
PetersenDidIt
Is that a shorthand I'm not familiar with, or should that be `input[type=text]`?
nikc
http://api.jquery.com/text-selector/
PetersenDidIt
Neat. Always something new everyday :-)
nikc