e.g: < /p>
Tag2 Tag2 Tag3 Tag4 sind alle bei leer um leer bei Anfang; < /p>
Tag1 wird mit Option 2 ausgewählt; < /p>
Tag2, 3, 4: Option: 1, 3, 4 (Option 2 wird entfernt); < /p>
Tag2 wird mit Option 1 ausgewählt; < /p>
Tag3, 4: Option: 3, 4 (Option 1 wird entfernt); < /p>
Tag3 wird mit Option 3 ausgewählt; < /p>
Tag4: Option 4 (Option 3 wird entfernt); < /p>
Tag4 wird ausgewählt. JavaScript So,
Aber das Problem ist ... < /p>
Nachdem alle Tags ausgewählt wurden, möchte ich eines der Tags ändern (und auch wieder sollten andere Tags automatisch sollten entsprechend geändert) .. < /p>
Gibt es einen besseren Weg, dies zu tun? >
Code: Select all
function removeOption()
{
var p1 = document.getElementById("player1");
var p2 = document.getElementById("player2");
var p3 = document.getElementById("player3");
var p4 = document.getElementById("player4");
var selections = [];
selections.push(p1, p2, p3, p4);
//traversal all the selections, if any not empty, remove its values under all other selections
var selected = [];
var unselected = [];
for(var i=0;i