diff --git a/001-counter-app/Sakib/index.html b/001-counter-app/Sakib/index.html new file mode 100644 index 0000000..2f160bb --- /dev/null +++ b/001-counter-app/Sakib/index.html @@ -0,0 +1,34 @@ + + + + + + + Counter App + + + + + + + + +
+

+ + +
0
+ + +
+ + +
+
+ + + + + + \ No newline at end of file diff --git a/001-counter-app/Sakib/script.js b/001-counter-app/Sakib/script.js new file mode 100644 index 0000000..4016d50 --- /dev/null +++ b/001-counter-app/Sakib/script.js @@ -0,0 +1,67 @@ +console.log(" nazmus sakib"); +var count =0; +function setapplicationtitle() +{ + const titleElement =document.getElementById('title'); +console.log(titleElement); +titleElement.innerText="Counter App"; +} +setapplicationtitle(); +const incrementButton = document.getElementById('increment'); +// --- this part of code is for showing alert when + Button is clicked !!! +// function increaseCount() +// { +// alert(' Increase Button Clicked!!!'); +// } +// incrementButton.addEventListener('click',increaseCount); + +const countshow= document.getElementById('counter'); +function increaseCount() +{ + if(count>=10) + { + alert('OverFlow !!!!'); + } + else + { + count=count+1; + countshow.innerText=count; + } + +} +incrementButton.addEventListener('click',increaseCount) + +const decrementButton =document.getElementById('decrement'); + + +// --- this part of code is for showing alert when - Button is clicked !!! +// function decreseCount() +// { +// alert('Decrese Button Clicked !!!'); +// } +// decrementButton.addEventListener('click',decreseCount); + +const showdecrement=document.getElementById('counter'); +function decrementCount() +{ + if(count===0) + { + alert("Negative Value is not acceptable !!!!"); + } + else + { + count=count-1; + showdecrement.innerText=count; + } + +} + +decrementButton.addEventListener('click',decrementCount); + + + +// const counterElement=document.getElementById('counter'); +// counterElement.innerText=3; + + +