JSFiddle

  • Html Table With Customized Width CSS Demo

    Html th custom css, th width not working

    <div class="row dataTable">
                                          <br>
                                            <table id="tbItems" >
                                                <thead>
                                                    <tr class="table-header">
                                                        <th >#</th>
                                                        <th >Item</th>
                                                        <th ><i class="fa fa-dollar"></i> Price</th>
                                                        <th ><i class="fa fa-shopping-cart"></i> Qty</th>
                                                        <th > Special Request</th>
                                                    </tr>
                                                </thead>
                                                <tbody>                                   
                                                <tr><td class="content-center" >1</td><td class="content-center" >Vegetable Samosa (G)</td><td class="content-center" >3.95</td><td class="content-center" >1</td><td class="content-center" ><div>sdskajsdjkas+dfkskfsdf+dskfskfs+sdkfksf</div></td></tr><tr><td class="content-center" >2</td><td class="content-center" >Onion Bhaji(V ...</td></tr></tbody></table></div>
  • JavaScript Objects #4 is the latest revision

    JavaScript Objects

    console.log(2 + 2);
    console.log(2 + "2");
    console.log(2 + "2" + 2);
    console.log(2 + 2 + "2" + 2);
    console ...
  • display a random number between 1 and 70.

    display a random number between 1 and 70.

    function myFunction() {
        var x = Math.floor((Math.random() * 70) + 1);
        document.getElementById("demo").innerHTML = x;
    }
  • reverse a string in javascript

    reverse a string in javascript

    var str="sibeesh";
    str= str.split("").reverse().join("");
    console.log(str);
  • A number is undefined and isNaN is true, but the type is undefined. How?

    A number is undefined and isNaN is true, but the type is undefined. How?

    var a;
    console.log(a);
    console.log(typeof(a));
    console.log(isNaN(a));
    console.log(typeof(undefined));
    console.log(isNaN ...
  • Substring VS Slice

    Substring VS Slice

    var str="Sibeesh";
    var outSub= str.substring(3,7);
    console.log(outSub);
    var outSlc= str.slice(3,7);
    console.log ...
  • check a driopdown values exists in jquery

    check a driopdown values exists in jquery

    $(function(){
    var checkVal='1';
      $('#Liste option').each(function(){
          if (this.value == checkVal) {
          	console.log(checkVal+ ' is found!');
          }
      });
    });
    
  • regex - two part number, not ending with dot or comma #2 is the latest revision

    regex - two part number, not ending with dot or comma

    
    var myReg = /^\d+(?:[.,]\d+)?$/;
    console.log(myReg.exec("123"));
    console.log(myReg.exec("123.123"));
    console.log(myReg.exec(".123 ...
  • infinite loop in jQuery

    infinite loop in jQuery

    var width = $(document).width() - $('#mydiv').width();
    $(document).ready(function() {
    
        function animateMydiv() {
            $('#mydiv').animate({
                    'left': width + 'px'
                }, 9000,
    
                function() {
                    $('#test').css ...
  • Change the ID of an element dynamically

    Change the ID of an element dynamically

        $(document).on('click', ".nuttonA",function(){
            alert("nuttonA is clicked "); 
            $("#buttonB").attr("id","notButtonB");
        });
    
        $(document).on('click', "#notButtonB",function(){
            alert("notButtonB ...