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

183
Views
Trying to create a connect metamask feature

I cannot for the life of me figure out what I am doing wrong. I am following the metamask docs and everything: https://docs.metamask.io/guide/create-dapp.html#basic-action-part-1

.html button:

 <!DOCTYPE hmtl>
<html lang="en">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width-device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" >
    
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <script src="https://cdn.jsdlivr.net/npm/web3@latest/dist/web3.min.js"></script>

    <script src="./javafilename.js"></script>
</head>
<body>
    <button class="btn btn-primary btn-lg btn-block mb-3" id="connectButton" value="Connect" enabled></button>
<body>
</html>

metamask java:

const initialize = () => {
    //Basic Actions Section
    const onboardButton = document.getElementById('connectButton');
  };
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I don't see an error in your code, it just that you need to keep following the instructions, by giving the current code i can see its working, take a look at this Codesandbox

https://codesandbox.io/s/kind-frost-f4zgd7?file=/index.html

If you notice, when you click the button, it tell us Metamask is installed

Few points.

  • On the documentation, they load this when the window load window.addEventListener('DOMContentLoaded', initialize); and you want to do it on a button, see onclick="initialize()"

Also please make sure for other questions to provide an error or something so the community can help you better

about 4 years ago · Juan Pablo Isaza 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!