Tuesday, 3 September 2013

Retrive json data based on select value

Retrive json data based on select value

I have a json data in following format
{"Jack":["my1@email.com","US"],"Rob":["rob@email.com","UK"]}
i have a select tag, if the value selected from a select box equal to
"Jack" then it should print the data "my1@email.com","US"
select box on change function is
function printDataOf(val){
now if selectd value is Jack
alert() // should alert my1@email.com
alert() // should alert US
how do i do it?

No comments:

Post a Comment