jQuery change the select box value based on anchor clicked

后端 未结 3 1178
轮回少年
轮回少年 2021-01-21 16:09

When some one clicks a link I need the select box value to change

Jan
Feb         


        
3条回答
  •  再見小時候
    2021-01-21 16:40

    Since the value values are saved at the href attribute, use:

    $("a.cli").click(function(event){ //when anchor is clicked
        event.preventDefault();
        $(".ui-datepicker-month").val($(this).attr("href"));
    });  
    

提交回复
热议问题