I made a very simple button click event handler, I would like to have element be appended when button clicked, you can check my code
1) jsFiddle loads in MooTools by default, you need to include jQuery for this to work. There is not a reason in the world why that example wouldn't work. (Assuming that the $
is actually mapped to the jQuery
object, that is.)
2) You can check the nextSibling
of a DOMElement
, or use the next()
jQuery method, like so:
if(!$('#something').next().length) {
//no next sibling.
}