Trigger Click Events with jQuery: Missing $ sign will still pass the test.
See original GitHub issueI Don’t know if it is a general issue or only related to this task. if i write folling code in the exercise:
$("#getMessage").on("click", function() {
//alert((".message"));
(".message").html("You clicked get Message");
});
This test will pass, even though i should have put a dollar sign before (“message”). I found this error when I passed the test, but the message didn’t change on the mobile screen. link
Challenge Name
Issue Description
Browser Information
- Browser Name, Version:
- Operating System:
- Mobile, Desktop, or Tablet:
Your Code
// If relevant, paste all of your challenge code in here
Screenshot
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (9 by maintainers)
Top Results From Across the Web
jquery 1.9.1 .trigger() not passing arguments to click-handler
It's a known issue: http://bugs.jquery.com/ticket/13353. Workaround is to use .triggerHandler() instead e.g.: $('#trigger').click(function (e) { var $test ...
Read more >.trigger() | jQuery API Documentation
The .trigger() method can be used on jQuery collections that wrap plain JavaScript objects similar to a pub/sub mechanism; any event handlers bound...
Read more >Lesson 1: Using JavaScript to Show an Alert
So far in this lesson, we have called the showAlert() function when the body of the web page is loaded. However, we could...
Read more >JavaScript Event Madness! Capturing *all* events without ...
When an event is triggered on an element, say a link, any event handler that is attached to this specific element will be...
Read more >Handling Events :: Eloquent JavaScript
At any point, an event handler can call the stopPropagation method on the event object to prevent handlers further up from receiving the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oh Yes, this is an utter confusion. Sorry my bad. @raynor84 @nishant-tomer thanks.
The tests are actually correct. the instructions confused me as well.
The code from the issue description is not required at all. The below block is unnecessary.
That’s the reason the tests do not look for it.
The below should rather be updated
to perhaps:
@nishant-tomer Yeah, the JSON and Ajax challenges need some love. But I like @raisedadead’s suggestion on the instruction changes.