Question: So, I have a dynamic number of list items and I would like to apply a style to the second to last.... IF only there are an even number of elements.

```
<ul>
  <li>One</li>
  <li>Two</li>
  <li>Three</li>
  <li>Four</li>
</ul>

```

I want to apply style to the Three li element in the above case, but nothing if as follows.

```
<ul>
  <li>One</li>
  <li>Two</li>
  <li>Three</li>
</ul>

```

Answer: 
Call `SingleCheckbox(this)` instead of `SingleCheckbox.call(this)` in `onclick` of chackbox like following.

```
@Html.CheckBoxFor(model => model.Approved, new { onclick = "SingleCheckbox(this)" })
@Html.CheckBoxFor(model => model.Rejected, new { onclick = "SingleCheckbox(this)" })

```

And `SingleCheckbox` should be like following.

```
var SingleCheckbox = function (rb) {
    var id = rb.id, uncheck;
    if (id == 'Approved') {
        uncheck = document.getElementById('Rejected');
    } else {
        uncheck = document.getElementById('Approved');
    }

    uncheck.checked = false;
}

```

**Update:** In asp.net mvc4 and it's earlier version `@Html.EditorFor` has no parameter for `htmlAtrributes`. You can use `@Html.CheckBoxFor` instead.

Hope this will help you.
Try this hopefully it will render the required markup having onclick in it

```
@Html.EditorFor(model => model.Approved, new { @onclick = '"SingleCheckbox.call(this)"' })

```