What would be the jQuery equivalent to this Prototype code?
If you don’t think this is relevant and close it, would you mind messaging me directly with a solution?
var comment_link = new Element('a', {
'title': "View snapshot",
'id': snapshot.id + '_comment',
'href': "#",
'class': ""
}).update(snapshot.name.truncate(13));
comment_link.observe('click', respondToClick);
comment_link.observe('mouseover', respondToMouseOver);
comment_link.observe('mouseout', respondToMouseOut);
I tried this to no avail:
var comment_link = new $j('<a/>', {
title: "View snapshot",
id: snapshot.id + '_comment',
href: "#",
class: ""
}).html(snapshot.name.truncate(13));
$j(comment_link).click(respondToClick);
$j(comment_link).mouseover(respondToMouseOver);
$j(comment_link).mouseout(respondToMouseOut);
should do it