Reply
Mon 7 Jul, 2014 08:10 am
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Design Shrit</title>
</head>
<body>
<table class="table table-bordered">
<thead>
<tr>
<th> Create Design </th>
</tr>
<tbody>
<tr>
<td>Color:
<select onChange="created(this.id,this.value)" id="color">
<option>white</option>
<option>red</option>
</select></td>
</tr>
<tr>
<td>Gender:
<select onChange="created(this.id,this.value)" id="gender">
<option>male</option>
<option>female</option>
</select></td>
</tr>
<tr>
<td>Sleeve:
<select onChange="created(this.id,this.value)" id="sleeve">
<option>full</option>
<option>half</option>
</select></td>
</tr>
<tr>
<td>Length:
<select onChange="created(this.id,this.value)" id="length">
<option>full</option>
<option>half</option>
</select></td>
</tr>
<tr>
<td>Wear:
<select onChange="created(this.id,this.value)" id="wear">
<option>top</option>
<option>bottom</option>
</select></td>
</tr>
</tbody>
</thead>
</table>
</body>
</html>
<script type="text/javascript">
'use strict'
var design = {
color: 'white',
gender: 'male',
sleeve: 'full',
length: 'short',
wear: 'top',
msg: function () {
return 'my selected design has ' + this.color + ' color with ' + this.length + 'length and ' + this.sleeve + ' sleeve having ' + this.wear + ' wear';
}
};
function created(key,val) {
//here I want to change a property which is got into key parameter
}
</script>