I have these two piece of scripts on my custom.js file. The first one triggers fine. But the second doesnt. Am I doing something wrong, like missing a bracket or something? I tried JSLing, but couldnt figure it out. Thanks guys
$(document).ready(function() {
$(".SubmitWrapper").click(function() {
$(".SubmitWrapper").replaceWith('<div class="SubmitWrapper"><div class="Button_Submit2"><a onClick="" href=""><span>Please ..</span></a></div></div>');
alert('fdsfds');
});
});
$(document).ready(function() {
$(document).on('click', 'ul.NFSelectOptions li', 'a', function() {
if ($(this).text() == "Feedback") {
$('body').html("hihi");
alert("Goodbye!");
}
});
});
This line is wrong:
It should be this:
All the pieces of the selector go in one string, not in two arguments. Your way puts the function in the wrong argument so it can never be called.