jQuery addClass example

Change class name on click in jQuery

by HSilvaDaytona

HTML

<div id="banner-message">
    <p>Complexity in Arrays</p>
    <h1 id="appText">Enter Array Size:</h1>
    <input type="textbox" id="location" value="10" />
    <p></p>
    <button onclick="fillArray();">Create Array</button>

    <p></p>

    <h2 id="appText">Enter Location:</h2>
    <input type="textbox" id="index" value="5" />
    <p></p>
    <h2 id="appText"> Enter Value to Insert:</h2>
    <input type="textbox" id="value" value="99" />

    <p></p>
    <button onclick="insertIntoArray();">Things</button>

    <p></p>
    <h3 id="appText"> Enter Value to Find:</h3>
    <input type="textbox" id="search" value="20" />
    <p></p>
    <button onclick="displaySearch();">WOW</button>
</div>

CSS

body {
  background: 	#fff;
  padding: 20px;
  font-family: Helvetica;
}

#appText{
  
  color:		#53abb5;
  font-size: 15px;
  text-align: left;
  transition: all 0.2s;
  margin: 0 auto;
  width: 300px;
  
}

#banner-message {
  background: 	#4d3727;
  color: 	#fffff0;
  border-radius: 4px;
  padding: 20px;
  font-size: 25px;
  text-align: center;
  transition: all 0.2s;
  margin: 0 auto;
  width: 500px;
}

button {
  background: 		#53abb5;
  font-family: Arial; 
  border: none;
  border-radius: 5px;
  padding: 6px 8px;
  font-size: 12px;
  color: 		#fffff0;
}

JavaScript

// find elements
var banner = $("#banner-message")
var button = $("button")

var array = []; //Global array to hold array
var d = ""; //Global string for output
var count = 0; //Global counter

function fillArray() {
   
}