Hi guys,
I’m trying to catch the value of radio button and print it to dialogue box.
As you can see here,
http://myonlinesmallgroup.com/warren/tooltip/tooltip4.php
As you can see it’s not working.
Sorry the jsfiddle version doesn’t work.
So what is wrong with my codes?
$(function() {
$("#op1").click(function(){
if ($("#op1").is(":checked")) {
var message = document.getElementById("op1").value;
$("#tooltip").html(message).show();
}
});
$("#op2").click(function(){
if ($("#op2").is(":checked")) {
var message = document.getElementById("op2").value;
$("#tooltip").html(message).show();
}
});
//Hide tooltip When outside tooltip is click.
$(document).mouseup(function (e)
{
var container = $("#tooltip");
if (!container.is(e.target) // if the target of the click isn't the container...
&& container.has(e.target).length === 0) // ... nor a descendant of the container
{
container.hide();
}
});
});
Thanks in advance