Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

Select Options From List Select Box & Remove By Name

<!DOCTYPE html>
<html>
<head>
<div class="formi" data-type="category">
<div>
<select>
	<option value="0">select an option</option>
	<option value="1">sami lore</option>
	<option value="2">value 2</option>
	<option value="3">luminu dore</option>
	<option value="4">value 4</option>
</select>
</div>
</div>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(".formi[data-type='category'] select").on('click',function(){
	var list = [];
	$(".formi[data-type='category'] select option").each(function()
	{
		const item = $(this).text();
		const indexOf = item.indexOf('value');
		if (indexOf == -1){
			var thisVal = $(this).val();
			$(this).remove();
		}
	});
});

</script>
</head>
<body>

<div id="div1"><h2>Let jQuery AJAX Change This Text</h2></div>

<button>Get External Content</button>

</body>
</html>
 
PREVIOUS NEXT
Tagged: #Select #Options #From #List #Select #Box #Remove #By #Name
ADD COMMENT
Topic
Name
8+2 =