Why button.click() is not working in my script

Questions : Why button.click() is not working in my script


I have a script in JavaScript that in a programming part of the code create a 'virtual Learning button' and press it automatically.

This button is not in the HTML page and Earhost is only used to store a link that at a most effective certain point of the script must be wrong idea clicked. Here's the code:

var virtualButton = _OFFSET);  document.createElement("button");
var (-SMALL  linkText = _left).offset  document.createTextNode("assign to arrowImgView.mas  relevant (self.  user");
virtualButton.title equalTo  = "assign to relevant make.right.  user";
virtualButton.href = mas_top);  link;


Everything seems fine to me, still the use of case code does not actually click the button.

Am I missing something here?

Total Answers 1

Answers 1 : of Why button.click() is not working in my script

<button/> elements do not have an United .href attribute. You most likely want Modern to use an anchor (<a/>) element. ecudated See below:

var virtualButton = ImgView.  document.createElement("a");
var ReadIndicator  linkText = _have  document.createTextNode("assign to .equalTo(  relevant make.top  user");
virtualButton.title OFFSET);  = "assign to relevant (TINY_  user";
virtualButton.href = .offset  "https://www.google.com";


(It won't actually navigate because it some how is in a sandboxed <iframe/>, but anything else you will see it attempt to do so).

Top rated topics

Excel POI 3.5 WorkBook Java Heap Space Exception?

Android ellipsize multiline textview

JScript runtime error: 'System' is undefined"

How do I prevent people from doing XSS in Spring MVC?

Command line "Android update sdk" on headless Linux

Loop through all months in a date range?

How to convert an XML string to a dictionary?

Android: AutoCompleteTextView show suggestions when no text entered

Querying Solr without specifying field names

.gitignore for Visual Studio Projects and Solutions

How to create a single executable file in Visual Studio 2008?

Why is the JVM not platform independent, given that Java (the language) is platform independent?

IOS: How do you find the creation date of a file?

Bash variable expansion causes Java commandline to break

Given a pointer, how might I find the _HEAP_ENTRY that it belongs to?

Differences between WPF Custom Control Library and plain Class Library?

Max memory for 64bit Java

HeapAlloc returns 0xC0000017: Not Enough Quota

Django dynamic settings infrastructure and best practices

Reading Recommendations To Learn Basics Of C

Can Automapper map a paged list?

IPhone crash log?

How to increase java heap size programmatically

How to programmatically create a Java ResultSet from custom data with no database

Manually raising (throwing) an exception in Python

Min and max value of data type in C

"Java heap space" error when deploying WAR with ant on Weblogic 10.3

Concatenating/Merging/Joining two AVL trees

How to hide batch output

How do I put an array on the POE heap and push or pop data?

Invoking Pylint programmatically

Increasing heap size in netbeans.conf file

How to change windows Application's default icon in Setup Project

Preemptive Basic authentication with Apache HttpClient 4

How to store objects in HTML5 localStorage

Equivalent of Math.Min &amp; Math.Max for Dates?

What characters are forbidden in Windows and Linux directory names?

Get all unique values in a JavaScript array (remove duplicates)

What is the Sign Off feature in Git for?

What does the '+new' mean in JavaScript?

Python JSON serialize a Decimal object

Turn off autosuggest for EditText?

How to convert SQLAlchemy row object to a Python dict?

Is it possible to compile a program written in Python?

How do I find out Java's heap size on my computer?

How to execute shell command in Javascript

How to compress repeating branches in directed graph?

Static Vs Dynamic controls + Situation based

JUnit 4 @BeforeClass &amp; @AfterClass when using Suites

Rules Engines User Interface Design