Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

231
Views
Error in Asp .net: Uncaught ReferenceError: HTMLButtonElement

I write this java script code for copy "txid" to the clipboard but i have this error: Uncaught ReferenceError: HTMLButtonElement this is my function:

function txidButtonCopy(txid) {
            
            var copyText = document.getElementById("txid");

            
            copyText.select();
            copyText.setSelectionRange(0, 99999); /* For mobile devices */

            
            navigator.clipboard.writeText(copyText.value);

            
            alert("txid");
        }

another part of code:

function txidButton(txid) {
            var disabled = 'disabled';

            if (txid!='') {
                disabled = '';
            }
            return '<button onclick="txidButtonCopy(' + txid + ')" ' + disabled + ' title="لینک تراکنش" class="btn btn-info" style="margin: 5px;"><i class="ion ion-ios-copy-outline"></i></button>';
        }
about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

You are grabbing the html button element by id when the element has no id. Give the element an id, or use document.getElementsByClassName.

function txidButton(txid) {
        var disabled = 'disabled';

        if (txid!='') {
            disabled = '';
        }
        return '<button id="txid" onclick="txidButtonCopy(' + txid + ')" ' + disabled + ' title="لینک تراکنش" class="btn btn-info" style="margin: 5px;"><i class="ion ion-ios-copy-outline"></i></button>';
    }
about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!