how to select the first div in jQuery


<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>first demo</title>
<style>
td {
color: blue;
font-weight: bold;
}
</style>
<script src="https://code.jquery.com/jquery-3.5.0.js"></script>
</head>
<body>

<table>
<tr><td>Row 1</td></tr>
<tr><td>Row 2</td></tr>
<tr><td>Row 3</td></tr>
</table>

<script>
$( "tr:third" ).css( "font-style", "italic" );
</script>

</body>
</html>

www.codegrepper.com
www.stackoverflow.com

how to remove first element of array in javascript


let numbers = ["I'm Not A Number!", 1, 2, 3];
numbers.shift();

var colors = ["red", "green", "blue"];
var red=colors.shift();
//colors is now ["green","blue"];

var arr = [1, 2, 3, 4];
var theRemovedElement = arr.shift(); // theRemovedElement == 1
console.log(arr); // [2, 3, 4]

var fruits = ["Banana", "Orange", "Apple", "Mango"]
fruits.shift()

var fruits = ["Banana", "Orange", "Apple", "Mango"];

console.log(fruits.shift()); // prints "Banana"
console.log(fruits) // prints ["Orange", "Apple", "Mango"]

var cats = ['Bob', 'Willy', 'Mini'];
cats.pop(); // ['Bob', 'Willy']

www.codegrepper.com
www.stackoverflow.com

how to remove first element of array javascript


let arrayCheck = ["Apple", "Grapes", "102", "CodeBreaker"]
arrayCheck.shift()

var fruits = ["Banana", "Orange", "Apple", "Mango"];

console.log(fruits.shift()); // prints "Banana"
console.log(fruits) // prints ["Orange", "Apple", "Mango"]

var arr = [1, 2, 3, 4];
var theRemovedElement = arr.shift(); // theRemovedElement == 1
console.log(arr); // [2, 3, 4]

var fruits = ["Banana", "Orange", "Apple", "Mango"]
fruits.shift()

www.codegrepper.com
www.stackoverflow.com