switchon@lavalamp.biz
+27(0) 83 419 4851 / +27(0) 21 036 1165
Application & software development
Get A Quote

    • Home
    • Services
      • Application & software development
      • Outsourced software development
      • Project based resourcing
      • Digital marketing & consulting
      • Graphic design & consulting
      • UI / UX design & consulting
      • Recruitment services
      • Lease an expert
    • About
      • How we work
      • NBConsult Group
      • Partners
      • Lightbox Digital
    • Blog
    • Join us
    • Contact

    • Home
    • Services
      • Application & software development
      • Outsourced software development
      • Project based resourcing
      • Digital marketing & consulting
      • Graphic design & consulting
      • UI / UX design & consulting
      • Recruitment services
      • Lease an expert
    • About
      • How we work
      • NBConsult Group
      • Partners
      • Lightbox Digital
    • Blog
    • Join us
    • Contact

    • Home
    • Services
      • Application & software development
      • Outsourced software development
      • Project based resourcing
      • Digital marketing & consulting
      • Graphic design & consulting
      • UI / UX design & consulting
      • Recruitment services
      • Lease an expert
    • About
      • How we work
      • NBConsult Group
      • Partners
      • Lightbox Digital
    • Blog
    • Join us
    • Contact

    • Home
    • Services
      • Application & software development
      • Outsourced software development
      • Project based resourcing
      • Digital marketing & consulting
      • Graphic design & consulting
      • UI / UX design & consulting
      • Recruitment services
      • Lease an expert
    • About
      • How we work
      • NBConsult Group
      • Partners
      • Lightbox Digital
    • Blog
    • Join us
    • Contact
    4 tips to make time estimating easier
    4 Tips To Make Time Estimating Easier
    Feb 11, 2021
    deploy static frontend sites instantly and for free with firebase
    Deploy Static Frontend Sites Instantly And For Free With Firebase
    Mar 9, 2021

    JavaScript Basics

    javascript basics
    javascript basics

    JavaScript is a programming language that can be used to extend the functionality of the front end of your website. It can change the way your webpage behaves, from updating form values to changing the background of an element when you hover over it.

    In the below example, we'll have a table and a label. When a user clicks on a table value, it will update the label with that table value.



    Setup


    To start, what we'll need to do is set up our web page. I've created a basic one, as can be seen below. Something to take note of is the script tag we're using to add jquery.min.js to our page, as well as the js/custom.js file where we've put out JavaScript.



    JavaScript


    Now that we have our web page set up, we can move on to the Javascript. The below is the js/custom.js.

    In the below example, we've wrapped our code in a document.ready() function. This is to ensure that the code only runs once the page is ready.

    Next, we find a table with the id of table, and bind a click even to every td inside of that table. Once a td is clicked, we take the text inside of it and set the text of the label above it.



    Conclusion


    This example shows you how to select an element, get data from it, and update a different value. Updating a value is one of the most common uses for JavaScript. That being said, there is so much more to learn when it comes to JavaScript. Hopefully, the above will be helpful when you want to get started.

    Contact us


      Related posts:

      laravel livewireLaravel Livewire 7 design principles for web design7 Design Principles For Web Design angularUpdating A Primitive Type Variable From A Service In Angular dynamic doughnut graph using laravel vue componentDynamic Doughnut Graph Using Laravel Vue Component
      Share
      70
      Taylor Plaatjies
      Taylor Plaatjies

      Leave a Reply Cancel reply

      Your email address will not be published. Required fields are marked *

      Lava Lamp Lab


      Like technology, a lava lamp constantly changes form, producing new conditions with every passing moment



      lava lamp lab facebook   lava lamp lab twitter   lava lamp lab linkedin   lava lamp lab instgram

      Services


      Application & software development

      Outsourced software development

      Project based resourcing

      Digital marketing & consulting

      Graphic design & consulting

      UI / UX design & consulting

      Contact Us


      +27(0) 83 419 4851

      +27(0) 21 036 1165


      switchon@lavalamp.biz


      Unit 1 Monaco Square,
      14 Church Street,
      Durbanville,
      Cape Town, 7550

      NBConsult Group


      nbconsult
      nbconnect msp
      nbclearning
      river broadband
      designer needed
      © 2023 Lava Lamp Lab (Pty) Ltd | All Rights Reserved | Privacy Policy
      Contact us now

        Application & software development

          Outsourced software development

            Project based resourcing

              Digital marketing & consulting

                Graphic design & consulting

                  UI/UX design & consulting

                    Lease an expert

                      Recruitment services

                        We are using cookies to give you the best experience on our website.

                        You can find out more about which cookies we are using or switch them off in settings.

                        Lava Lamp Lab
                        Powered by  GDPR Cookie Compliance
                        Privacy Overview

                        This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

                        Strictly Necessary Cookies

                        Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.

                        If you disable this cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again.

                        3rd Party Cookies

                        This website uses Google Analytics to collect anonymous information such as the number of visitors to the site, and the most popular pages.

                        Keeping this cookie enabled helps us to improve our website.

                        Please enable Strictly Necessary Cookies first so that we can save your preferences!

                        Cookie Policy

                        More information about our Cookie Policy