• Post Reply Bookmark Topic Watch Topic
  • New Topic

jQuery select default item in select  RSS feed

 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know it possible to set the default, but is it possible to do it dynamically? I'm trying to set a date drop down for today's date.



This doesn't work because of the variable in the code. Any advice? The following works but its not dynamic.
 
Author and ninkuma
Marshal
Posts: 66345
155
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If all you need to do is to embed the value of m in the selector, then simple JavaScript string concatenation will suffice:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!