/ Published in: jQuery
![](/img/icon_sav.png?v3)
Set a variable by getting the URLs id with PHP. Find the the option with the name value that is equal with the variable and add "selected" to it.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
var pId = "<? echo $_GET['category'] ?>"; $("select#category option[name=" + pId + "]").prop("selected", true);
Comments
![RSS Feed for Comments RSS Icon](/images/rss.png?v3)