Reputation: 11
So I have the small code snippet below, which I would ideally like to call the function to alert me with hello when the #results_more element is clicked...
$('results_more').observe('click', function(evt) {
alert('hello');
});
However, I think I'm doing something terribly wrong if something this easy doesn't work. Anything I may be overlooking with the Prototype library, or Javascript in general?
Upvotes: 1
Views: 67
Reputation: 94284
At face value, there shouldn't be anything wrong with your code, but you aren't giving enough information.
id="results_more"
exist? What is the result if you alert($('results_more'))
?dom:loaded
event listener.Take a look at jsfiddle.net/zDa7m for a simple example.
Upvotes: 1