Nasrul Hazim Bin Mohamad

jQuery Mobile: Set Selected Item for jQM Select


There’s a minor different how to set selected item in drop down list in jQuery Mobile. We can’t set by using standard jQuery $().val(value);. Here the workaround

$("#selector option[value='your-value']").attr('selected', 'selected');  

Reference: Is there a way to set the selected value in JQM select?

WordPress: Install from Composer


Create a composer.json in project root directory and copy paste the following composer configuration. Then run composer install.

    "name": "blog/your-name",
    "description": "my Official blog",
    "repositories": [
      "type": "composer",
      "url": ""
    "require": {
        "php": ">=5.4",
        "johnpbloch/wordpress": "4.2"
    "extra": {
        "wordpress-install-dir": "wp"

Once done, copy wp/index.php to project root directory and update require( dirname( __FILE__ ) . '/wp-blog-header.php' ); to require( dirname( __FILE__ ) . '/wp/wp-blog-header.php' );.

Now run the WP at http://localhost/wp-project-root and continue with installation and you’re done.


  1. Using Composer With WordPress
  2. Composer in WordPress
  3. Giving WordPress It’s Own Directory