Yilmaz Paçariz
Yilmaz Paçariz

Reputation: 186

select box append with js variable

function trig(){        
        var a=$('#rolAdd option:selected').text();
        var b=$('#rolAdd option:selected').attr("value");

     $("#rolRemove").html("<option value='b'> a </option>");

}

how can i use a & b variables from rolAdd select box in rolRemove select box...

Upvotes: 0

Views: 52

Answers (1)

Sudhir Bastakoti
Sudhir Bastakoti

Reputation: 100205

Do you mean:


$("#rolRemove").html("<option value='"+b+"'>"+ a + "</option>");

Upvotes: 1

Related Questions