JSFiddle

  • Select with edit option #1 is the latest revision

    jQuery 1.9.1, HTML, CSS, JavaScript

    var initialText = $('.editable').val();
    $('.editOption').val(initialText);
    
    $('#test').change(function(){
    var selected = $('option:selected', this).attr('class');
    var optionText = $('.editable ...
  • Name match email #2 is the latest revision

    jQuery 1.9.1, HTML, CSS, JavaScript

    $(document).ready(function() {
            $("#fname").keyup(function() {
                if (this.value == "Kasey") {
                    $("#Nmail").val("123@mail.com");
                }
                
                if (this.value == "Jec") {
                    $("#Nmail ...
  • Common typing textarea #2 is the latest revision

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

    $('.jml').on('focus', function(e) {
      $('#divChoices').show();
      $('#ch1').val(this.value).focus();
      //
      // add class to current input field
      //
      $(this).addClass ...
  • Clearable input field

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

    Array.prototype.forEach.call(document.querySelectorAll('.clearable-input>[data-clear-input]'), function(el) {
      el.addEventListener('click', function(e) {
        e.target.previousElementSibling.value = '';
      });
    });
  • localstorage setitem #36 is the latest revision

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

    $('#add').click(function() {
      localStorage.setItem("foo", "bar");
    });
    
    $('#delete').click(function() {
      localStorage.removeItem("foo");
    });
  • datalist array #2 is the latest revision

    jQuery 1.9.1, HTML, CSS, JavaScript, jQuery Mobile 1.2.0

    var nameArray = ["Rick Bross","Madison Smith","Jack Johnson"]; //Example of my array
    for (var i = 0; i < nameArray.length; i++) {
        
        $('#potentials').append("<option value='" + nameArray[i] + "'>");
    }
  • Auto font resize

    jQuery 1.9.1, HTML, CSS, JavaScript, jQuery Mobile 1.2.0

    $('#location').keypress(function() {
      
      var textLength = $(this).val().length;
      
      if(textLength < 20) {
       // Do noting 
      } else if (textLength < 40) {
          $(this).css('font-size', '85%');
      } else if (textLength > 40) {
          $(this).css('font-size', '70%');
      }
      
     //console.log(textLength);
    });
  • popup inputbox #20 is the latest revision

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

    
    $('.jml').on('focus', function(){
        $('#divChoices').show()
        thefield = $(this).prev()
        $('.btnselect').on('click', function(){
            theselected = $(this).prev()
            thefield.val( theselected.val ...
  • save checkbox html5 #13 is the latest revision

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

    $(function () {
        var data = localStorage.getItem("showning");
        if (data !== null) {
            $("input[name='switch_show']").attr("checked", "checked");
        }
    });
    
    $("input[name='switch_show']").click(function ...
  • inputbox focus resize #1 is the latest revision

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

    <input id="inputfield" placeholder="Enter Text">