Knowing the name of a WEB button [closed]

0

I wanted to ask if there is any way to see the name of a button on a web page, because seeing the HTML code is not possible..name "does not appear. Does anyone know another way to find out?

    
asked by Javier 02.09.2016 в 17:55
source

4 answers

2

In your specific case, DevTools (the tool you are using) is the closest way to see the attributes in real time , that is, after JavaScript or some other method has modified the elements in the DOM.

In this case the name attribute was not defined, and since it has no default value, we simply do not get it if we want to access it (we get a value of null .

console.log(document.getElementById('enviar').getAttribute('name'));
<input id="enviar" type="submit" class="submit" value="Ingresar">
    
answered by 02.09.2016 в 18:09
1

The reality is that every browser needs to access the HTML code to be able to display a Web page. Therefore there will always be some way to see it or get it.

In this case, simply the one who developed the page did not put the attribute name in the input submit, that's why it's not that you do not see it, it does not exist.

    
answered by 02.09.2016 в 18:04
1

It is a submit type input, the value is obtained in the following way:

document.getElementById('enviar').value

Assuming the input, the id "send" is given in the following way:

<input id="enviar" type="submit" class="submit" value="Ingresar">
    
answered by 14.10.2016 в 21:08
0

Why would someone try to get the name of input ? What you really want is to activate the function that is executed when click is clicked on the enter button.

I guess the solution is something like this.

document.getElementsByTagName("form")[0].submit()

But first you would have to edit the text text fields so that there is no authentication error.

    
answered by 14.09.2016 в 03:28