Compose a link based on the option value of select


I have 2 dropdown menus, and I need to compose a link with it's values.

Here is the code:

<form id="dropdown1">
    <select id="linha">
        <option value="G12">Option 1</option>
        <option value="G11">Option 2</option>
        <option value="H89">Option 3</option>
    <select id="dia">
        <option value="all">Every day</option>
        <option value="work">working days</option>
        <option value="sat">saturday</option>
        <option value="sun">sunday</option>

I need something in JavaScript to "compose" a link with*selected_linha_value*/*selected_dia_value*

How can I do that?

Take a look at:

You can use jQuery val() to get the value of the select boxes. Then just append these values to the base url.

var url = "" + $('#linha').val() + "/" + $('#dia').val();