Question: Does anyone know why, in this example, the click event is not being fired only in IE8? Basically, the css style after a click (`.zui-act`) should change the `background-color` of the `label`.

[JSFIDDLE](http://jsfiddle.net/7dFeS/)

```
<div style="width:300px;">
   <input type="radio" name="a" id="a" value="alpha" />
   <label for="a">Alpha</label>
   <input type="radio" name="a" id="b" value="bravo" />
   <label for="b">Bravo</label>
   <input type="radio" name="a" id="c" value="charly" />
   <label for="c">Charly</label>
</div>​

$.radio = function(e) {
    var a = $('input:radio').filter(function(index) { return $(this).attr('name')==e });
    a.hide();
    a.siblings('label').addClass('zui-btn');
    a.click(function(){
        var f = $(this).attr('id');
        $('label').removeClass('zui-act').filter(function(index) {
            return $(this).attr('for')==f
        }).addClass('zui-act');
    });
}

$(document).ready(function(e) {
    $.radio('a'); 
});

```

Answer: 
I think you almost solved your own problem.

I would retrieve the number of record

```
Integer singleResult = em.createQuery("SELECT count(r) FROM RealEstate r", Integer.class).getSingleResult();

```

Then, I would create a random number out of that and finally

```
    Random random = new Random();

        RealEstate RealEstate = em.createQuery("SELECT r FROM RealEstate r", RealEstate.class)
            .setFirstResult(random.nextInt(size))
            .setMaxResults(1) 
            .getSingleResult();

```
i would do something like this for ***random data*** 

```
SELECT column FROM table  
ORDER BY RAND ()  

```

thank to javatpoint nice tutorial

[javatpoint take a look at here](http://www.javatpoint.com/sql-order-by-random)