Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
82
rated 0 times [  84] [ 2]  / answers: 1 / hits: 17604  / 12 Years ago, thu, may 31, 2012, 12:00:00

I have the following function which is activated on click:



$('.results .view-rooms').click(function(){   }


Is there anyway I can trigger this function on document load?


More From » jquery

 Answers
21

Yes.



$(document).ready(function(){ // on document ready
$(.results .view-rooms).click(); // click the element
})

[#85233] Wednesday, May 30, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
virginia

Total Points: 632
Total Questions: 95
Total Answers: 95

Location: China
Member since Mon, Aug 22, 2022
2 Years ago
;