Editing Langarth This edit will create a new revision. Your details (optional) Name Email (won’t be displayed; might be used for Gravatar) URL Test case details Title * Published (uncheck if you want to fiddle around before making the page public) Description (in case you feel further explanation is needed)(Markdown syntax is allowed) Are you a spammer? (just answer the question) Preparation code Preparation code HTML (this will be inserted in the <body> of a valid HTML5 document in standards mode) (useful when testing DOM operations or including libraries) <ul id="main_nav"> <li> <a href="#" id="mission_nav" title="View the Langarth mission" style="color: rgb(156, 165, 174);">Mission.</a> </li> <li> <a href="#" id="guarantee_nav" title="View the Langarth guarantee" style="color: rgb(156, 165, 174);">Guarantee.</a> </li> <li> <a href="#" id="understand_nav" title="Langarth want to understand our customer goals" style="color: rgb(67, 90, 104);">Understand.</a> </li> <li> <a href="#" id="define_nav" title="Langarth will help you define your brand" style="color: rgb(156, 165, 174);">Define.</a> </li> <li> <a href="#" id="promote_nav" title="Langarth will work with you to help you promote your company" style="color: rgb(156, 165, 174);">Promote.</a> </li> <li> <a href="#" id="contact_nav" title="Contact Langarth about working with you." style="color: rgb(156, 165, 174);">Contact.</a> </li> </ul> <script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"> </script> Include JavaScript libraries as follows: <script src="//cdn.ext/library.js"></script> Define setup for all tests (variables, functions, arrays or other objects that will be used in the tests) (runs before each clocked test loop, outside of the timed code region) (e.g. define local test variables, reset global variables, clear canvas, etc.) (see FAQ) Define teardown for all tests (runs after each clocked test loop, outside of the timed code region) (see FAQ) Code snippets to compare Test 1 Title Async (check if this is an asynchronous test) Code $('#main_nav').on('click', 'a', function(e) { e.preventDefault(); var _el = e.target.id; }); Test 2 Title Async (check if this is an asynchronous test) Code $('#main_nav').on('click', 'li a', function(e) { e.preventDefault(); var _el = e.target.id; }); Test 3 Title Async (check if this is an asynchronous test) Code var $nav = $('#main_nav') $nav.on('click', 'li a', function(e) { e.preventDefault(); var _el = e.target.id; }); Test 4 Title Async (check if this is an asynchronous test) Code var $nav = $('#main_nav') $nav.on('click', 'a', function(e) { e.preventDefault(); var _el = e.target.id; }); Test 5 Title Async (check if this is an asynchronous test) Code $('#main_nav a').css('color', function() { // }); Test 6 Title Async (check if this is an asynchronous test) Code $('a', '#main_nav').css('color', function() { // }); Test 7 Title Async (check if this is an asynchronous test) Code $('#main_nav').find('a').css('color', function() { // }); Test 8 Title Async (check if this is an asynchronous test) Code var $nav1 = $('#main_nav') $nav1.find('a').css('color', function() { // });