<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);
});
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.