I have the following:
<div class="tab-pane" id="message">
<textarea rows="4" cols="50" id="send_message" placeholder="Enter text ..."> </textarea>
<a href="#message" class="btn btn-large btn-info" data-toggle="tab">OK</a>
<a href="#message" class="btn btn-large btn-info" data-toggle="tab">Cancel</a>
I want to bind the click method to the 'a' elements , and when one is clicked do separate things. I am trying to distingish between them using the button text but I'm getting a syntax error when I do:
$(function(){
$('#message > a').click(function(){
if(this:contains("OK"))) {
// code to be executed if condition is true
}
else {
// code to be executed if condition is false
}
....
How can I fix this?