Jump to content
Fórum Script Brasil
  • 0

Javascript


Guest JrLima
 Share

Question

Alguém sabe adicionaar nova opção em alguma caaixa?

tipo a do orkut.. ex:

________________

País: |BRASIL |

|ESTADOS UNIDOS |

|ÁFRICA |

alguum que tiipo esse aqui :S

java script: showUploadPhoto();

Agraadeço ;*

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Alguém sabe adicionaar nova opção em alguma caaixa?

tipo a do orkut.. ex:

________________

País: |BRASIL |

|ESTADOS UNIDOS |

|ÁFRICA |

alguum que tiipo esse aqui :S

java script: showUploadPhoto();

Java Script: NewOption...

ALGUMAA COISAAA ASSIM ;@~

Agraadeço ;*

Link to comment
Share on other sites

  • 0

Seria isto?

<script>
function AddItem(novo_item){

var select=document.getElementById("itens");
var options = select.getElementsByTagName("option");
var novo_select=document.createElement('option');
novo_select.text=novo_item;
novo_select.value=options.length+1;
var sel=select.options[select.length];
select.add(novo_select,select.length);
}
</script>

<form name="form">
<input type="text" name="add_item">&nbsp;<input type="button" value="Adicionar" onclick="AddItem(document.form.add_item.value)">
<select name="itens">
<option value="1">Selecione</option>
<option value="2">Opção 1</option>
</select>
</form>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Forum Statistics

    • Total Topics
      149.8k
    • Total Posts
      646.6k
×
×
  • Create New...