Skip to content

Frame work

LS MADHURIMA requested to merge lsmadhurima-main-patch-11029 into main

I'm copying the code of Activity 2 Replace the images and GIFs with new ones also the function also after enabling the third and fourth functions, the pictures from the first and second function should be disabled (should not be displayed). The images displayed by the placing function should disappear after the connect function is enabled.


Bulb without switch

Activity 2 : To glow a bulb

You only need three things to perform this activity...

  1. Battery
  2. Bulb
  3. Wires
bulb gif Click on the buttons in order :
<div class="buttons">
    <img src="D:\html\internship22\batteryconnected.jpg" align="right" style="display:none;" id="batterycon" >
    <img src="D:\html\internship22\batteryplaced.jpg" align="right" style="display: none;" id="batteryplac">
    <img src="D:\html\internship22\bulbplaced.jpg" align="right" style="display: none;" id="bulbplac">
    <img src="D:\html\internship22\bulbconnected.jpg" align="right" style="display: none;" id="bulbcon">
    <button onclick="PlaceBulb()">1. CLICK TO PLACE BULB</button>
    <button onclick="PlaceBattery()">2.CLICK TO PLACE BATTERY</button>
    <button onclick="BulbConnect()">3.CLICK TO CONNECT WIRES TO BULB</button>
    <button onclick="ConnectBatteryBulb()">4.CLICK TO CONNECT BATTERY WITH BULB</button>
<script type="text/javascript">
    function PlaceBulb()
        display_image('bulbplaced.jpg', 100, 100, 'JavaScriptImage');


    function PlaceBattery(){

    function BulbConnect()
    {   display_image('bulbconnected.jpg',100,100,'bulb connected');

    function ConnectBatteryBulb()
    {   display_image('circuitgif.gif',200,200,'working');
    function display_image(src, width, height, alt)
        var a = document.createElement("img");
        a.src = src;
        a.width = width;
        a.height = height;
        a.alt = alt;

//this function is still not tested function removeElement(ele) { ele.parentNode.removeChild(ele); }



Merge request reports