Trailmax Tech

Max Vasilyev: ASP.Net MVC development in Aberdeen, Scotland
Skip to content
  • My Talks
  • cacheCopy
  • NSaga
  • Cake.SqlServer
  • About

JQuery: select first element from drop-down with a value

Posted on February 4, 2013July 13, 2013 by trailmax

I’m not that good with jQuery and selectors, but Pratik helped me out with this puzzle.

For our Selenium tests I needed a jQuery function that would select a first element from the drop-down that does have a value

$('#elementID option:not([value=""]):eq(0)').attr('selected', 'selected');
Uncategorized   jquery
0

Tags

.Net asp.net Autofixture automation azure Azure-DevOps bat build server BuildServer c# cakebuild commands Dependency Injection di drivers eclipse EntityFramework git html https Identity iis java javascript jquery Linux microsoft mocking mvc OpenXml recipe regexp Registry script sql sql server stackoverflow testing tfs unit-testing Vista visual studio Windows Wireless XP

Blogroll

  • HR.Net Consaltancy and blog
  • My Git Cheat-Sheet
  • My Twitter
  • Wordpress Hosting

Recent Posts

  • Laundry Basket Bias
  • mstsc.exe vs HD screen
  • Windows Terminal
  • Using private NuGet feed with dotnet publish
  • Keyboard Shortcuts for Git in Visual Studio
Powered by WordPress | Theme: Bootstrap Basic