0

I have develope a program to get selected text from dropdown menu. This code is working in jsFiddle. but doesn't work in Browser. Is anything problem in jquery coding?

Dropdown

$(document).ready(function(){

    $('#ddl').change(function(){  
        var text= $('#ddl :selected').text();
        $('#ddltext').html(text);     
    });

});

CSPIT ADIT BVM DDIT Nirma

Thanks in advance.

1
  • No, check your console for errors! Commented Aug 31, 2013 at 19:56

2 Answers 2

1

try this:

$('#ddl').change(function(){
    var text= $('#ddl option:selected').text(); 
    $('#ddltext').html(text);
});

working fiddle here: http://jsfiddle.net/APNFd/

i hope it helps.

Sign up to request clarification or add additional context in comments.

Comments

0

Try disabling Plugins and change global variables name if it works with Jsfiddle not in browser this mean conflict in plugins scripts.
If this does not work please show us all of the codes to detect errors.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.