0
   

How to change a specific object property based on passed function parameters

 
 
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>
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Question • Score: 0 • Views: 560 • Replies: 0
No top replies

 
 

Related Topics

 
  1. Forums
  2. » How to change a specific object property based on passed function parameters
Copyright © 2024 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 05/16/2024 at 08:26:32