Monthly Archives:November 2010

Bind Unbind event in JQuery

22 Nov 10
admin
No Comments
Hai,

We can bind an event using .bind() methode of JQuery.

For example:
$(“#buttonId”).bind(‘onclick’, functionName);
or
$(‘#buttonId).bind(‘click’, function() {
alert(‘User clicked’);
});

Unbinding is done by using .unbind()

Example:

$(“#buttonId”).unbind(‘onclick’);

Happy Programing…

Selected text of a dropdownlist using jQuery

12 Nov 10
admin
No Comments
Hai,

Selected text of a dropdownlist using jQuery

$(‘select[id$=dropdownlistId] :selected’).text()

Happy Programing…

Selected value of radiobuttonlist using JQuery

12 Nov 10
admin
No Comments
Hai,

We will get selected value of a radiobuttonlist using following JQuery code

$(‘#radiobuttonId input[type=radio]:checked’).val();

Happy Programing…

Scroll bowser window to top using JQuery

12 Nov 10
admin
No Comments
Hai,

Using JQuery we can scroll browser window to top position.

$(‘html, body’).animate({ scrollTop: 0 }, ‘fast’);

Happy Programing…