When this fires I see the added li for a split second and then it disappears….
What gives? Using jquery 1.4.2
$(function(){
$('a#add_phone').click(function () {
$('<li>Test</li>').appendTo('ol#phones');
});
});
Ok so this works in a blank page, but this is in the context of a rails 3 app. Must be something in there, although I can’t see what.
There must be something else there… if you paste that code in a new page with this HTML snippet it should work just fine:
Look for other JS files conflicting with your code, or even the same file, another line. Or maybe CSS if you’re using a slow browser (ehem…)
But that code seems flawless..