Jump to content

[Resolvido] obter valor do input


emanuelx
 Share

Recommended Posts

<!--item 1-->
<div style="clear:both;" class="small-3 columns">
       <a href="#" class="button tiny">Button Tiny</a>
</div>
<div class="addbutton small-9 columns">
       <input class="input_b" type="text" placeholder="Text of button" />
       <a  class="button small" data-b="button tiny">Adicionar</a> <!--carregar neste botao-->
</div>

<!--item 1-->
<div style="clear:both;" class="small-3 columns">
      <a href="#" class="button small">Button Small</a>
</div>
<div class=" addbutton small-9 columns">
     <input class="input_b" type="text" placeholder="Text of button" />
       <a   class="button small" data-b="button small">Adicionar</a> <!--carregar neste botao-->
</div>

Boas, fica aqui umas questão, não sei se dá para fazer ou não, era ao carregar no botao adicionar ele obtem o valor do input, isto através do jquery, visto que eu tenho vários elementos com a mesma classe como é que eu posso fazer isso?

cumps

com calma e sem stresses

Link to comment
Share on other sites

fica aqui o codigo se alguem vier a precisar

$('.b').click(function(){
console.log($(this).parent('.addbutton').find('input[type=text]').val());
console.log("zzz");
console.log($(this).attr('data-b'));
// console.log($('.input_b').val());
});

com calma e sem stresses

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.