-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
alert not showing #9
Comments
I think this wouldnt work with jQuery either, since the $(document).ready(function() {
$('body').append("<input type='button' id='alertdiv' value='Text of Alert Button' style='cursor:pointer' />");
$('body').click(function(event) {
if ($(event.target).is('#alertdiv')){
alert("Hello, world!");
}
});
}); Since PS: In jQuery you have the advantage with the selector attribute for $(document).ready(function() {
$('body').append("<input type='button' id='alertdiv' value='Text of Alert Button' style='cursor:pointer' />");
$('body').on('click', '#alertdiv', function(event) {
alert("Hello, world!");
});
}); |
I have tested that jQuery 2.1.3 does run both your code examples as well as the example I provided. |
Isn't there a This one works for me (tested on both Chrome and Firefox). And $(document).ready(function () {
$("body").append('<input id="alertdiv" type="button" value="Text of Alert Button" style="cursor:pointer" />');
$("#alertdiv").on("click", function () { alert("Hello!"); });
}); |
@vkeusebio is right, Sprint doesn't support shorthand methods like |
Nice library indeed!
Just noticed this issue, the code below is not showing the alert as its should show the alert from the function of the click event of the button.
The text was updated successfully, but these errors were encountered: