Reputation:

jQuery JavaScript

How can I write this code:

$(function()
{ 
$('#datetime').datepicker({duration: '',showTime: true,constrainInput: false});
});

in JavaScript onclick?

Upvotes: 0

Views: 93

Answers (2)

rahul
rahul

Reputation: 187110

$("#youdbuttonid").bind("click", function(){
      $('#datetime').datepicker({duration: '',showTime: true,constrainInput: false});
});

Upvotes: 1

Sorantis
Sorantis

Reputation: 14732

$('#myBtn').click(function(){
$('#datetime').datepicker({duration: '',showTime: true,constrainInput: false});
})

Upvotes: 4

Related Questions