Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dynamically remove select option value using href - jquery

I am having a list of users with delete hyperlink assume

<a href="#" onclick="delete(id)">Delete</a>

And i have a combo box at the top to filter specific user using user id.

The delete action will performed with ajax and it reloads the content. The content gets reloaded but the combo box contains the deleted id. Is there any way to clear it using jquery.

like image 299
Prabhakaran Avatar asked Mar 13 '26 19:03

Prabhakaran


1 Answers

You can remove an option like

$("#selectBox option[value='option1']").remove();
like image 95
Farhan Avatar answered Mar 16 '26 09:03

Farhan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!