I want to be able to remove only New button after two seconds, not Hey buttons.
・What I tried I wrote this code and then the result was all buttons disappeared for sure. Is it able to spot and remove only the button made by JavaScript?
$('button').html('<em>Hey</em>');
let newbtn = '<button>New</button>';
$('h1').append(newbtn);
setTimeout(() => {
$('button').hide();
}, 2000);
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQuery</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1 class="big-title margin-50">Hello.</h1>
<img src="drum.png" alt="">
<a href="http://www.google.com">Search</a>
<button>Click Me.</button>
<button>Click Me.</button>
<button>Click Me.</button>
<button>Click Me.</button>
<button>Click Me.</button>
<input type="text" name="" value=" ">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="index.js"></script>
</body>
</html>