dimanche 19 avril 2015

Missing formal parameter javascript

I am making an object. I have to assign key and value from html fields. But when I am doing that. It is giving an error "missing formal parameter". fiddle



<span class="value">
<input type="checkbox" name="slt" value="1">
<input type="checkbox" name="slt" value="0" checked="checked">
</span>


<select class="key">
<option value="1">one</option>
</select>


var a= {$('[name="slt"]:checked').val():$('.key').val()}
console.log(a)

Aucun commentaire:

Enregistrer un commentaire