I've got a room booking form which has a couple of fields that are linked. When a user selects a room from a <select> it should update the "No of attendees" <select> with options up to the room capacity.

For example, if I pick one room with a capacity of 15, the "No of attendees" select should have options up to 15. If another room with capacity of 25 is selected, the attendees select should have options upto 25.

Can anyone help with the javascript for this? I'm struggling!