JSFiddle

  • Select first .show element

    Select first .show element by using the general sibling selector

    <div class="hide"></div>
    <div class="show"></div>
    <div class="hide"></div>
    <div class="show"></div>
    <div class="show"></div>
    <div class="show"></div>
  • Navigation Menu

    Option #2 Using Linear Gradient background

    $('.trigger-dropdown').on('click', function(e) {
      e.preventDefault();
      $(this).parent('li').toggleClass('open-dropdown');
    });
  • Navigation Menu

    Option #1 flex approach

    $('.trigger-dropdown').on('click', function(e) {
      e.preventDefault();
      $(this).parent('li').toggleClass('open-dropdown');
    });
  • Tiptools Edit State

    Raw structure for edit state on Tiptools

    $('.count').on('click', function(e) {
      e.preventDefault();
     $(this).children('.int').each(function() {
        $(this).text('Update');
      });
      
      
    });
  • FizzBuzz

    No-Library (pure JS), HTML, CSS, JavaScript

    var div3 = 3,
    		div5 = 5,
        divBoth = 15,
        divNone = 17;
        
        
    function fizzBuzz(num) {
    	if ( (num%3 == 0) & (num%5 == 0)) {
      	return 'fizzbuzz';
      }
    	else if(num%3 ...
  • Marketo After

    jQuery 2.1.4, HTML, SCSS, JavaScript

    
    
    
  • Marketo Before

    No-Library (pure JS), HTML, CSS, JavaScript

    <script src="//app-ab13.marketo.com/js/forms2/js/forms2.min.js"></script>
    <form id="mktoForm_67"></form>
    <script>MktoForms2.loadForm("//app-ab13.marketo.com", "175-ORF-032", 67);</script>
  • While Matching Brackets

    No-Library (pure JS), HTML, CSS, JavaScript

    function matchBrackets(string) {
        var currLeft = 0;
        var currRight = 0;
        
        while( string.length > 0) {
            var currLeft = string.indexOf('(');
            var currRight = string ...
  • Reverse the Matrix #1 is the latest revision

    No-Library (pure JS), HTML, CSS, JavaScript

    // [1 2]  --> [2 1]
    // [3 4]  --> [4 3]
    
    var matrix = [[1,2,6],[3,4,9]];
    
    function reverseMatrix(matrixArray) {
      var ...
  • Reverse the sentence words #5 is the latest revision

    No-Library (pure JS), HTML, CSS, JavaScript

    var string = "cats love dogs and cows";
    
    function reverseSent(string) {
        var splitString = string.split(' ');
        var finalString = ""; 
        for(var i=0 ...