Jquery event on wrapped input radio override 'checked' event?

Try this out.. $("td"). Click(function(e) { if (e.target. Type!

== 'radio') { $(this). Find(":radio"). Trigger('click'); } }); Example on jsfiddle.

If you want to make the td and radio button toggle the radio checked property you could do something like this: $("td"). Toggle(function() { $(this). Children(":radio").

Attr("checked", true); }, function() { $(this). Children(":radio"). Attr("checked", false); }); Example on jsfiddle.

Thanks, worked! – Luccas Feb 23 at 20:38.

Why not just call the default click event on the input tag: $(this). Children("input").click().

It does not work – Luccas Feb 23 at 20:15.

Responding to your comment: "i want to check radio button when I click both td or the radio button" Should be as simple as: $("td"). Click(function(e) { $(this). Find("input").

Attr("checked", true); }); jsfiddle.net/lukemartin/UJXRu/3.

This answer doesn't treat radio buttons as check-boxes (Users really don't like that) and attempts to provide a slightly more realistic scenario. $("tr. MyRow").

Click(function(e) { // don't override the radio inputs default if ($(e. Target). HasClass("childRadio") || e.target.

TagName == 'LABEL') return; // find the child radio, and if it's not checked, check it. Var $childRadio = $("input. ChildRadio", $(this)); if (!$childRadio.

Attr('checked')) { $childRadio. Attr('checked', 'checked'); } }); I've gone to the trouble of adding labels, and have used the name property so that the radio buttons are grouped (which is the reason to have a radio buttons). So this keeps as much default behavior as possible, and is just augmenting clicks to select a specific child radio button.

The html sample is below. Some Content Radio 1 Label More Content Radio 2 Label.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions


Thank You!
send