get parant redio button images

<div class=”myimage” id=”myimage1″>
<a id=”bigImg” href=”” title=”robbie” class=”ajax quick-view-rob”>
<img class=”img1″ id=”img1″ src=”” height=”300″ />


jQuery(‘ul.options-list li input[type=”radio”]’).click(function() {
var curImg = jQuery(this).parent().find(‘img’).attr(‘src’);
var curAnc = jQuery(this).parent().find(‘a’).attr(‘href’);
jQuery(‘#bigImg’).attr(‘href’, curAnc);
jQuery(‘#img1’).attr(‘src’, curImg);


jQuery : Simple onclick email Validation function

<form method="post" name="form1" action="">

   <label>Email Address:</labe>
   <input type="text" name="UserEmail" id="UserEmail" value="" size="32" />
   <input type="submit" value="Submit" id="btn-submit" />

============================jQueyr fucnction=================================

$(document).ready(function() {

    $('#btn-submit').click(function() { 
        var hasError = false;
        var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
        var emailaddressVal = $("#UserEmail").val();
        if(emailaddressVal == '') {
            $("#UserEmail").after('<span>Please enter your email address.</span>');
            hasError = true;
        else if(!emailReg.test(emailaddressVal)) {
            $("#UserEmail").after('<span>Enter a valid email address.</span>');
            hasError = true;
        if(hasError == true) { return false; }

jQuery/Javascript page redirect with alternative

var your_url = ''; //change this to your url

Above code works to redirect page in jQuery, but javascript code is good alternative here.

Using javascript to redirect your page using below code, which is better than jQuery, will do the job:


Another javascript approach which will mock as if the URL is being clicked to redirect is:

window.location.href = "";

Even this will do the trick in javascript, which sets your URL in a window object and assigns it to anchor tag’s href attribute automatically:

window.location = "";