i have the following Html
<input class="top-display" value="5+5" id="display" disabled="disabled"> </input>
<button class="btn" > submit </button>
And jquery
$('.btn').click(function(){
var selected = $('#display').val();
alert(selected);
});
fiddle Here my focus for this code is letting jquery to automatically do the math for me. like instead of jquery alerting "5+5" it should alert "10". and if the value = "5-5" is should alert "0"; without adding any if statement.