Thursday, 6 May 2021

JQUERY14

 

<html>

<head>

<html>

<head>

<script src = "https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>

<script>

function Removeoptions()

{

$('#Fruit')

.empty()

.append('<option selected="selected" value="check">Mango</option>');

}

</script>

</head>

<body>

<select id='Fruit'>

<option value="Papaya">Papaya</option>

<option value="Kiwi">Kiwi</option>

<option value="Apple">Apple</option>

</select>

<input type="button" value="Click to Remove all Fruits" onclick="Removeoptions()"/>

</body>

<HTML>