JSFiddle

  • text caret position #3 is the latest revision

    jQuery 1.9.1, HTML, CSS, JavaScript

    jQuery("#btn").on('click', function() {
        var caretPos = document.getElementById("txt").selectionStart;
        var textAreaTxt = jQuery("#txt").val();
        var txtToAdd = "more text ...
  • jQuery UI date picker #3 is the latest revision

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

    $(function() {
        $("#enquiry").datepicker({
            defaultDate: "+0d",
            changeMonth: true,
            numberOfMonths: 2,
            onSelect: function(selectedDate) {
                $("#from").datepicker("option", "minDate", selectedDate);
                $("#from").removeAttr("disabled ...
  • listtoarray #4 is the latest revision

    jQuery 1.11.0, HTML, CSS, JavaScript

    var list1 = [], list2 = [], list3 = [];
    
    var $list1 = $("#list1").find("option");
    $list1.each(function () {
      var $option = $(this).attr("value");
      list1.push($option ...
  • windows mobile style transform #3 is the latest revision

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

    <div id="button">Defaults (both 0.33)</div>
  • hover css animation #32 is the latest revision

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

    <div id="parent">Hover on me...
        <div id="myDiv">Hello!</div>
    </div>
  • remove table #3 is the latest revision

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

    var table = document.getElementById("fileTable");
    
    window.onload = function () {
        table.innerHTML = 'I removed the table';
        console.log(table);
    }
  • header and footer

    header and footer

    <div id="container">
        <div id="header">Header!</div>
        <div id="footer">Footer!</div>
    </div>
  • simple layout #3 is the latest revision

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

    <div class="wrapper">
        <div class="left-menu">
        </div>
        
        <div class="content">
        </div>
        
        <div class="right-menu">
        </div>
    </div>
  • focus on click

    jQuery 1.11.0, HTML, CSS, JavaScript

    var $allWraps = $("#mainBody .wrap");
    
    $allWraps.each(function () {
        $(this).on("click", ".kid ", function () {
            setFocus($(this));
        });
    });
    
    function setFocus(f) {
        $allWraps.each(function ...
  • dragons hole

    dragons hole

    // Characters
    var warrior = {
    	name: "Warrior",
    	health: 100,	// Live
    	attack: 8,		// Attack
    	expWar: 50,		// Warrior special experience after kill
    	expFight: 10 ...