Questions tagged as 'javascript'

2
answers

How do I call a function that prints the name of the calling function?

I have the following function: function imprimir(id, nomeFuncao) { console.log('id: ', id, 'Funcão que chamou: ', nomeFuncao) } I want the imprimir() function to print to console.log the information of this function call:...
asked by 02.11.2016 / 01:52
3
answers

Include link if it is first element

I have a menu with four items. The menu is manageable, not manual via HTML. I want to modify a link in the first Menu item, how can I do this with Jquery? I do not even know how to look to do this. For example: <li class='classe' oncl...
asked by 11.03.2014 / 17:57
2
answers

Name not printing

What I wanted was to get the name of the person shown with the alert but I'm not able to My html code var nome = document.getElementById('id1').value; function clique(){ alert(nome); } <input id="id1" type="text"/> <butt...
asked by 02.10.2018 / 22:06
3
answers

Concatenate a link inside a href attribute with a variable?

I would like to know how do I concatenate a link within a href attribute with a variable? Note must be something 'inline' . I use a platform that does not let me use scripts inside the page so the inline reason. Example: var teste = [x];...
asked by 09.05.2014 / 16:47
1
answer

How does this code break the string into parts?

Through this question: How to remove all element from array except the first one in javascript . I've adapted the code for my need. var rua = 'RUA NILO PEÇANHA'; const head = ([x, ...xs]) => x const tail = ([x, ...xs]) => xs c...
asked by 02.10.2018 / 22:27
3
answers

Remove key pressed in an input text

I have the following scenario: A input text that comes with a certain value / text from the DB but that the user should not be able to edit. To do this, pressing a key on input will delete that same character. What I'm doing is:...
asked by 11.03.2014 / 12:49
3
answers

How can I display any JavaScript object as a string?

If I have any object like new MeuObjeto() , and I want to display all its internal properties as string. How can I do this? When I use alert(new MeuObjeto()) the result is [object Object] . But I want the content of the obj...
asked by 03.08.2016 / 16:21
2
answers

How to add a DIV to every 3 paragraphs (p)

Well, what I want is simple. I need to add one div every 3 paragraphs. Remember that these paragraphs will be in another div (in case it would be the content div). It is similar to that of site , where it is found the announcement. It wou...
asked by 19.04.2016 / 21:47
3
answers

Allow Select PDF only in JS

I would like to know how to do that by choosing the file to upload it to filter by native .pdf extension html or by JS, Jquery. Using the type="file" it brings all the files. <!DOCTYPE html> <html> <body> <h1&g...
asked by 03.08.2018 / 22:29
2
answers

Mouse cursor - JavaScript and CSS

cursor: pointer is a CSS property that defines the mouse cursor as a "pointer" over a given element. So far everything is quiet, it is worth mentioning that in JavaScript I can also add a mouse cursor to a certain event. document...
asked by 20.09.2018 / 02:13