Warsaw, Poland
tomandquery@gmail.com

Tomasz Rutkowski

Notes and varieties
Iterate over object and array
4.08.2018

Iterate over object and array

var obj = { name: “Tom”, age: “30”, hobbies: { photography: “nature”, isHappy: true }, array: [1, ‘one’, true] } for (var property in obj) { if (obj.hasOwnProperty(property)) { console.log(obj[property]); } } Object.keys(obj).forEach(function(key, index, value)...
Read more
Delete/Clear all cookies
6.06.2018

Delete/Clear all cookies

function deleteAllCookies() { var cookies = document.cookie.split(";"); for (var i = 0; i < cookies.length; i++) { var cookie = cookies[i]; var eqPos = cookie.indexOf("="); var name = eqPos > -1 ? cookie.substr(0, eqPos) :...
Read more
Auto increment of table rows numbering
21.02.2018

Auto increment of table rows numbering

table.portfolio.css { counter-reset: rowNumber; } table.portfolio.css tbody tr { counter-increment: rowNumber; } table.portfolio.css tbody tr td:first-child::before { content: counter(rowNumber); min-width: 1em; margin-right: 0.5em; color: rgb(63, 81, 181); } table.portfolio.css tbody tr td:first-child::after { content: '...
Read more

Checkbox custom styles

.custom-checkbox[type="checkbox"] { -webkit-appearance: none; background-color: #ebeaea; border: none; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), inset 0px -15px 10px -12px rgba(0, 0, 0, 0.05); padding: 11px; border-radius: 0px; display: inline-block; position: relative; margin-left: -20px;...
Read more

Save form state, serialize, cookie, local storage – working

<style> body { width: 100%; height: 100%; background-color: grey; } </style> <body> <form action="self" method="post"> <div> <label for="name">Name:</label> <input type="text" id="name" name="user_name"> </div> <div> <label for="mail">E-mail:</label> <input type="email" id="mail" name="user_mail"> </div> <div> <label for="msg">Message:</label> <textarea...
Read more
1 2 3 4 15