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

112
Views
javascript message dissapear

im wondering how i can make a message dissapear on this script after 5 seconds? Im kinda new at alot of this.

<script type="text/javascript">
    if (localStorage) {

        var UserName = localStorage.getItem("UserName");
        document.getElementById('notes').value = UserName;
    }

    function SaveToOfflineStorage() {
        try {
            if (localStorage) {
                var txtValue = document.getElementById('notes').value;
                localStorage.setItem("UserName", txtValue);
                document.getElementById('msg').innerHTML = ' - Saved Successfully!';
                setTimeout(msg, 5000);

            }

        }
        catch (err) {
            document.getElementById('msg').innerHTML = err.Description;
        }
    }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can do it like this,

function SaveToOfflineStorage() {
    try {
        if (localStorage) {
            var txtValue = document.getElementById('notes').value;
            localStorage.setItem("UserName", txtValue);
            document.getElementById('msg').innerHTML = ' - Saved Successfully!';
            setTimeout(() => {
                document.getElementById('msg').innerHTML = '';
            }, 5000);

        }

    } catch (err) {
        document.getElementById('msg').innerHTML = err.Description;
    }
}
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!