JSFiddle

  • SO-47402368

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

    function existsWithin(needle, haystack, matchOrder) {
      if (needle.every(
          value => haystack.includes(value)
        )) {
    
        let indicesMatchingFirst = haystack.map(
            (value, index) => value == needle ...
  • SO-47286526 #1 is the latest revision

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

    document.querySelectorAll('.submitbutton').forEach(
      button => button.addEventListener('click',
        event => {
          let checked = Array.from(
            document.querySelectorAll('input[type=checkbox]')
          ).filter(
            checkbox ...
  • SO-47276349

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

    <ul class="pagination">
      <li class="pagination__item pagination__item--active">
        <a class="pagination__link" href="#">
          Page 2
        </a>
      </li>
      <li class="pagination__item">
        <a class="pagination__link" href="#">
          Page 1
        </a>
      </li>
      <li class="pagination__item">
        <a class="pagination__link" href="#">
              left
            </a>
      </li>
    </ul>
    
  • SO-47186054

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

    <ul>
      <li class="langLI" style="list-style-type:none"><a href="/Regal-en-us/non-discrimination-and-language-assistance##Non-Discrimin">English</a></li>
    </ul>
    
  • 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 ...