{"action":"opened","issue":{"url":"https://api.github.com/repos/nobleclem/jQuery-MultiSelect/issues/1","labels_url":"https://api.github.com/repos/nobleclem/jQuery-MultiSelect/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/nobleclem/jQuery-MultiSelect/issues/1/comments","events_url":"https://api.github.com/repos/nobleclem/jQuery-MultiSelect/issues/1/events","html_url":"https://github.com/nobleclem/jQuery-MultiSelect/issues/1","id":121330175,"number":1,"title":"Use proper property access","user":{"login":"browner87","id":283902,"avatar_url":"https://avatars.githubusercontent.com/u/283902?v=3","gravatar_id":"","url":"https://api.github.com/users/browner87","html_url":"https://github.com/browner87","followers_url":"https://api.github.com/users/browner87/followers","following_url":"https://api.github.com/users/browner87/following{/other_user}","gists_url":"https://api.github.com/users/browner87/gists{/gist_id}","starred_url":"https://api.github.com/users/browner87/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/browner87/subscriptions","organizations_url":"https://api.github.com/users/browner87/orgs","repos_url":"https://api.github.com/users/browner87/repos","events_url":"https://api.github.com/users/browner87/events{/privacy}","received_events_url":"https://api.github.com/users/browner87/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-09T20:17:45Z","updated_at":"2015-12-09T20:17:45Z","closed_at":null,"body":"Please see my patch below. Using attributes for selected and checked is not ideal (see http://api.jquery.com/prop/).\r\n\r\n\r\n\r\n--- jquery.multiselect.js\r\n+++ jquery.multiselect.js\r\n@@ -51,10 +51,10 @@\r\n                         .attr( 'id', 'ms-opt-'+ msCounter )\r\n                 );\r\n \r\n-                if( $(option).attr( 'selected' ) ) {\r\n+                if( $(option).prop( 'selected' ) ) {\r\n                     container.addClass('default');\r\n                     container.addClass('selected');\r\n-                    container.find( 'input[type=\"checkbox\"]' ).attr( 'checked', 'checked' );\r\n+                    container.find( 'input[type=\"checkbox\"]' ).prop( 'checked', true );\r\n                 }\r\n \r\n                 var label = $('<label></label>').attr( 'for', 'ms-opt-'+ msCounter );\r\n@@ -333,7 +333,7 @@\r\n                 var select = optionsWrap.parent().prev();\r\n \r\n                 // toggle clicked option\r\n-                select.find('option[value=\"'+ $(this).val() +'\"]').attr(\r\n+                select.find('option[value=\"'+ $(this).val() +'\"]').prop(\r\n                     'selected', $(this).is(':checked')\r\n                 ).closest('select').trigger('change');\r\n \r\n@@ -356,7 +356,7 @@\r\n \r\n                 // get selected options\r\n                 var selOpts = [];\r\n-                select.find('option[selected=\"selected\"]').each(function(){\r\n+                select.find('option:selected').each(function(){\r\n                     selOpts.push( $(this).text() );\r\n                 });\r\n \r\n"}}