Jump to content

How to execute a JQuery method?


galvin

Recommended Posts

New to JQuery...

 

If I have this in the HEAD of my document (which works fine to display a blank field that, if you click, pops up a datepicker set to today's date)...

 

	<script>
$(function() {
	$( "#datepicker" ).datepicker({
		dateFormat: 'mm/dd/yy'

	});
});
</script>

 

How would I implement this "Method" below?

 

.datepicker( "setDate" , 11-11-2011)

 

Basically, when someone goes to this page with the DatePicker, I want the date 11-11-2011 to appear in the field/datepicker by default.  It sounds like this "setDate" Method is what I should use to do this, but I can't figure out where exactly to put this code (i.e. in the same script tags above, or somewhere else on the page), and need to know exactly how to write it.

 

Can anyone help?

Link to comment
https://forums.phpfreaks.com/topic/222511-how-to-execute-a-jquery-method/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.