JSFiddle

  • SO-44473541 #2 is the latest revision

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

    // a named function bound to an element via
    // via JavaScript; the 'event' argument
    // is passed automatically from the
    // EventTarget.addEventListener ...
  • SO-44219845

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

    // Get all the row elements and attach a click event handler for each of them
    var rows = document.querySelectorAll("tr ...
  • SO-43958938

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

    function transposeTwoStrings(arr) {
      var arr1 = arr[0];
      var arr2 = arr[1];
      var largerArray;
    
      if (arr1.length > arr2.length) {
        largerArray = arr1 ...
  • SO-43700037 #1 is the latest revision

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

    function filterHTML(htmlString, permitted) {
      let temp = document.createElement('div');
      
      permitted = permitted.map(
        el => el.toLowerCase()
      );
    
      temp.innerHTML = htmlString;
    
      let allElements ...
  • SO-43695431 #1 is the latest revision

    jQuery 3.2.1, HTML, CSS, JavaScript

    // using attribute-selection to identify the <input> elements
    // whose 'type' attribute is equal to 'radio', and binding the
    // anonymous function of the ...
  • SO-43572028 #1 is the latest revision

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

    function replaceElementWith(opts) {
      let settings = {
        'replaceWhat': '#mydiv',
        'replaceWith': 'button',
        'text': 'this is a button',
        'eventHandlers': null
      };
    
      Object.keys(opts).forEach ...
  • SO-43436908

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

    function numbersBetween(lower, upper, haystack) {
      if (haystack.every(value => Number(value))) {
    
        return haystack.filter(
          n => n > lower && n < upper
        );
      }
      return [];
    }
    
    let list ...
  • SO-43436118 #2 is the latest revision

    jQuery 3.2.1, HTML, CSS, JavaScript

    $('input').on('input', function() {
      let form = $(this.form);
      $(this).toggleClass('ERR_INPUT', this.required && !this.validity.valid);
      form.find('input[type=submit]').prop('disabled ...
  • SO-43277192

    jQuery 3.2.1, HTML, CSS, JavaScript

    $(function() {
      $("#btnAdd").bind("click", function() {
        AddControl();
      });
    
      $("#btnGet").bind("click", function() {
        var values = "";
        $("input[name=DynamicTextBox1]").each(function() {
          values += $(this).val ...
  • SO-43239127 #1 is the latest revision

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

    <div class="header blue">header here</div>
    <p>LOGO here</p>
    <div class="blue navigation">navigation bar here</div>
    <div class="content">
      No content.
    </div>
    <div class="footer">footer is here</div>