Jump to content
View in the app

A better way to browse. Learn more.

Portal do Host

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Bom dia galera,

Eu estou com uma dúvida referente a um menu drop down, se eu não estiver enganado, sei que é necessário javascript para fazer o que eu quero, que é basicamente o seguinte:

Quando a pessoa selecionar uma opção no menu drop down, a área determinada mude o seu valor de acordo com o que for selecionado.

Eu vou deixar uma imagem detalhando o que eu quero.

Agradeço quem puder compartilhar conosco essas informações. 

dropdown.png

 


Bom dia Igor,

fiz isso a algum tempo com javascript, é bem simples. Veja:

Código do Select:

<select onchange="javascript:open_tab(this.value)">
<option value="0">Opção 0</option>
<option value="1">Opção 1</option>
</select>

Código do javascript (função open_tab - nome que eu dei a função):

<script type="text/javascript">
function open_tab(id) {
	var local1 = document.getElementById("IDdoSPAN");
	if(id == 0) {
	    local1.innerHTML = 'COLOQUE O NOVO TEXTO AQUI OU COD HTML';
	}
	if(id == 1) {
	    local1.innerHTML = 'COLOQUE O NOVO TEXTO AQUI OU COD HTML';
	}
}
</script>

É possível alterar atributos CSS também utilizando assim:

document['getElementById']('IDdoSPAN')['style']['border'] = '';

E por fim, no seu HTML, defina o lugar onde quer alterar o conteúdo, assim:

<span id="IDdoSPAN">Opção 0</span>

Pode usar com div também, se preferir.


  • Author

Bom dia Igor,

fiz isso a algum tempo com javascript, é bem simples. Veja:

Código do Select:

<select onchange="javascript:open_tab(this.value)">
<option value="0">Opção 0</option>
<option value="1">Opção 1</option>
</select>

Código do javascript (função open_tab - nome que eu dei a função):

<script type="text/javascript">
function open_tab(id) {
	var local1 = document.getElementById("IDdoSPAN");
	if(id == 0) {
	    local1.innerHTML = 'COLOQUE O NOVO TEXTO AQUI OU COD HTML';
	}
	if(id == 1) {
	    local1.innerHTML = 'COLOQUE O NOVO TEXTO AQUI OU COD HTML';
	}
}
</script>

É possível alterar atributos CSS também utilizando assim:

document['getElementById']('IDdoSPAN')['style']['border'] = '';

E por fim, no seu HTML, defina o lugar onde quer alterar o conteúdo, assim:

<span id="IDdoSPAN">Opção 0</span>

Pode usar com div também, se preferir.

Pedro, funcionou certinho! 

Me ajudou e tenho certeza que vai ajudar muita gente, valeu!

 



Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Recently Browsing 0

  • No registered users viewing this page.

Important Information

Do you agree with our terms?

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.