Silentbob
Silentbob

Reputation: 3065

using 2 jquery widgets in one page

This might be the dumbest question but I cant find an answer.

How do I reference 2 jquery widgets in 1 page. Should it be like this

<script type="text/javascript">

$(function () {
    $('#ReleaseDate').datepicker({ dateFormat: "dd-mm-yy" });
    $(document).tooltip();
});

or like this

<script type="text/javascript">

$(function () {
    $('#ReleaseDate').datepicker({ dateFormat: "dd-mm-yy" });

});

$(function () {
    $(document).tooltip();

});

Or is it a different way as I cant get it working either eay.

Upvotes: 0

Views: 24

Answers (1)

Afzaal Ahmad Zeeshan
Afzaal Ahmad Zeeshan

Reputation: 15860

Both would do the trick, but the first one would be my preference, since it would let me write-less-do-more!

You can use/prefer the first one, it has less lines. But will give you the same output as the second code. Because it has less lines, so it would be more preferred.

Please remember, to write-less-do-more.

Upvotes: 1

Related Questions