How do you assign object properties?

Answers were Sorted based on User's Feedback



How do you assign object properties?..

Answer / m_xyz

var obj=new Object();
obj["age"]=18; or obj.age=18

Is This Answer Correct ?    19 Yes 0 No

How do you assign object properties?..

Answer / team sam onn

var obj=new Object();
obj["age"]=18; or obj.age=18

Is This Answer Correct ?    7 Yes 0 No

How do you assign object properties?..

Answer / rubin thomas

var regiondb_stcty = new Object()

regiondb_stcty["Andaman and Nicobar"] = [ {value:"Port
Blair", text:"Port Blair"}];

u can do assign option elements with this object;
like a state city dyanmic population.

email me if u want thsi code

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More JavaScript Interview Questions

What is difference between local and global scope in javascript ?

0 Answers  


print the following using loop. 54321 4321 321 21 1

2 Answers   Delhi Public School,


How is javascript different from java?

0 Answers  


What is js injection?

0 Answers  


what is a difference of subclass and main class

0 Answers  






Do I need to install javascript?

0 Answers  


How can I prevent others from reading/stealing my scripts or images?

0 Answers  


Describe negative infinity in javascript?

0 Answers  


hi i want validations for two drop down lists. when user enter to second list by skipping first list alert box should appear. <HTML><HEAD> <TITLE>drop down validation</TITLE> <script type="text/javascript"> function validateForm(){ if(document.ItemList.Item.selectedIndex==0) { alert("Please select item from first list."); document.ItemList.Item.focus(); return false; } return true; } </SCRIPT> </HEAD> <BODY> Please choose an item from the drop down menu: <form name="ItemList" method="post" action="asp.html" onsubmit="validateForm()"> <table width="100%" border="0"> <tr> <td width="135">Choose a username: </td> <td> <select name="Item"> <option value selected> SELECT </option> <option value>Apples</option> <option value>Oranges</option> </select> <table width="100%" border="0"> <tr> <td width="135">Choose a username: </td> <td> <select name="Item" onclick="validateForm()"> <option value selected> SELECT </option> <option value>Apples</option> <option value>Oranges</option> </select> <input type="submit" name="Submit" value="Submit"> </td></tr></table></form> </BODY> </HTML> please any body help me thanks

0 Answers  


What is the statement to enable strict mode in javascript quiz?

0 Answers  


How to write comment in JavaScript?

0 Answers  


Explain export & import in javascript?

0 Answers  


Categories