Questions tagged as 'javascript'

4
answers

Pass a JavaScript variable to CSS

What I want is to catch the total height of the page and apply a CSS depending on the result. JS: $altura = document.body.scrollHeight; CSS: #id{ height: $altura; } Something like that, how should it be done?     
asked by 08.09.2017 / 16:05
2
answers

How to add a table dynamically with jquery?

I am trying to add a table in which encloses the inputs that I show below, the headers are static but I have not been able to add them successfully because if I create the table the delete button stops working, clarify that this button was desig...
asked by 05.09.2017 / 21:34
3
answers

How to add events to a list of buttons in a cycle with Jquery?

Good, I have this in my Jquery code: $("#borrarImagen0").click(function() { editarImagen(0); }); $("#borrarImagen1").click(function() { editarImagen(1); }); <script src="https://ajax.googleapis.com/a...
asked by 11.09.2017 / 14:22
3
answers

Get the variable id that contains a label to

I'm trying to get through JS the id that has a tag. The id is going to vary, so when doing onClick I have to know it. <a href="#" role="button" onClick="abrirNoticia();" id="id">Título</a> As for the function, I was using the fo...
asked by 18.07.2017 / 20:21
1
answer

I need to validate income of multiples of 100 by javascript, but it does not work

The following javascript does not work for me, I need help function validaMultiplos100(num) { if (num % 100 == 0) { saldo.setCustomValidity(''); } else { saldo.setCustomValidity("No es multiplo de 100");...
asked by 07.07.2017 / 02:17
1
answer

Error in execution of function on an object

What I want to achieve is that if the message has the same or more than 15 characters it would show me this.c as true osino as false , but it shows me undefined .. why? function A() { this.mp = f...
asked by 02.07.2017 / 17:32
5
answers

Swapping two objects by changing the result in JavaScript

I have two objects, and I want to return them permuted in JavaScript , that is, if I enter a and b as arguments, I return [b,a] , changing the order . But I do not want a function that only returns the permuted result, bu...
asked by 08.07.2017 / 04:38
1
answer

Create Javascript Object with Text String Templates

I wanted to know if I can define an object in javascript with the text string templates ('') and if so, what would be the correct syntax. I mean something like: var mi_objeto = '{prop: 1, atr: 2}';     
asked by 03.07.2017 / 13:02
1
answer

Really what is the difference when using semicolons?

var f = "hola"; (() => { console.log(f); })(); This code works perfectly, and I understood that the IIFE , could not access variables and functions outside of this, then is not it? and I have read about pr...
asked by 10.08.2017 / 18:01
1
answer

How to enter objects properly?

What happens is that I'm creating an object calling clanes , within which are all the clans, in an array clan , and another with its supposed owners , but as I can know , that, in the case of my example, the clan 'DW' , belong...
asked by 28.06.2017 / 23:15