HTML5 jQuery and Arrays

by nickadeemus2002

HTML

<div id="notice">
    
</div>

<button id="testButton" type="button" name="button" value="click me"> Click Me</button>


<div id="xyz"><p>this is the xyz div</p></div>

CSS

span{font-weight:bold; color:#ff0000;}

JavaScript

$(document).ready(function() {

    var test_array = [1, 2, 3, 4, 5, 'my simple string'];
    var popped_value = test_array.pop();
    //alert(popped_value);
    var array_content = test_array.join(" ");

    $('#notice').html("<h2>The last element in the 'test_array' was popped off, and we are left with <span>" + array_content + "</span></h2>");


    $('#testButton').click(function() {
        $('#xyz').css({
            'color': 'red',
            'font-weight': 'bold'
        });

    });


    //REGEX STUFF

    function removeSubString(needle, haystack) {
        //alert(haystack.replace(new RegExp(needle,'gi'), "[OU-SUX-DICK]"));
    }


    var strText = "I saw this girl walking down the street the\n" + "other day as I was leaving work. She had calves\n" + "that were crazy large; so big and round. The kind\n" + "of calves that you'd want to get down on your hands\n" + "and knees just to touch.";


    removeSubString("OU", strText);


});