Reputation: 3523
I am trying to add the ajax response text, to a div that has a class on it, and not an id. I try the following:
var notice = $$('.testdiv');
Element.update(notice, transport.responseText)
This doesn't work but if I change it to update an element that has an ID on it, it works.
var notice = $('testdiv');
Element.update(notice, transport.responseText)
Upvotes: 0
Views: 639
Reputation: 2076
This is because $$('.testdiv')
is returning an array. Try this:
Element.update(notice[0], transport.responseText)
Upvotes: 1