javascript sources
1 subscriber
1 photo
1 link
Hello world
Download Telegram
Forwarded from coding with ☕️
window.pageXOffset is an alias of window.scrollX.
window.pageYOffset is an alias of window.scrollY.
Forwarded from coding with ☕️
click – when the mouse clicks on an element (touchscreen devices generate it on a tap).
contextmenu – when the mouse right-clicks on an element.
mouseover / mouseout – when the mouse cursor comes over / leaves an element.
mousedown / mouseup – when the mouse button is pressed / released over an element.
mousemove – when the mouse is moved.
Forwarded from coding with ☕️
keydown va keyup - klaviatura tugmasi bosilganda va qo'yib yuborilganda.
Forwarded from coding with ☕️
<input type="button" id="button" value="Button">
<script>
button.onclick = function() {
alert('Click!');
};
</script>
Forwarded from coding with ☕️
<input id="elem" type="button" value="Click me"/>
<script>
function handler1() {
alert('Thanks!');
};
function handler2() {
alert('Thanks again!');
}
elem.onclick = () => alert("Hello");
elem.addEventListener("click", handler1); // Thanks!
elem.addEventListener("click", handler2); // Thanks again!
</script>
Forwarded from coding with ☕️
button.addEventListener("click", () => alert("1"));
Forwarded from coding with ☕️
button.removeEventListener("click", () => alert("1"));
Forwarded from coding with ☕️
const fruits = ["Banana", "Orange", "Apple", "Mango"];
console.log(fruits);
Forwarded from coding with ☕️
const person = {
name: "Alice",
age: 15,
city:"New York"
};
console.log(person);
Forwarded from coding with ☕️
const person = {firstName:"John", lastName:"Doe", age:50, eyeColor:"blue"};
Forwarded from coding with ☕️
const person = {
firstName: "John",
lastName: "Doe",
age: 50,
eyeColor: "blue"
};
Forwarded from coding with ☕️
const person = {};

// Add Properties
person.firstName = "John";
person.lastName = "Doe";
person.age = 50;
person.eyeColor = "blue";
Forwarded from coding with ☕️
objectName.propertyName
objectName["propertyName"]
Forwarded from coding with ☕️
const person = {
firstName: "John",
lastName: "Doe",
age: 50,
eyeColor: "blue"
};

delete person.age;
console.log(person);
Forwarded from coding with ☕️
const person = {
firstName: "John",
lastName: "Doe",
id: 5566,
fullName: function() {
return this.firstName + " " + this.lastName;
}
};

// `fullName` metodini chaqirish va uning natijasini konsolga chiqarish
console.log(person.fullName());