Alex,

On Mon, Oct 20, 2008 at 3:38 AM, Alex Hempton-Smith <
[EMAIL PROTECTED]> wrote:

> I'm using the Flot graphing plugin and I'd like to be able to have a
> specific series highlighted depending on the URL, as I want to link to it.
>
> This will mean activating a checkbox depending on the URL, for example:
>
>   /results/#science
>
> Would activate the checkbox with ID of 'science' or something similar, so
> when the user clicks a link with that #science parameter, the default
> checkbox to be ticked on pageload is 'science'.
>
> Any way this can be achieved easily in jQuery?
>

Something like this should work:

$(document).ready(function (){

    if( location.hash ){
        $("#" + location.hash).attr("checked", true);
    }

});

-Dan

Reply via email to