Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Recent content by Padonak

  1. Padonak

    JavaScript document.body.textContent with replace or replace all

    I'm not that good in regular expressions, but hope this crutch helps console.log( document.body.innerText .replace(/([\s\d]+).([\d]+),([\d]{2})/g , '$1$2,$3') .replace(/([\d]+),([\d]{2})/g , '$1.$2') ) I believe this can be done with only one replace, may be somebody knows how
  2. Padonak

    JavaScript document.body.textContent with replace or replace all

    Can, for example, translating this page from English to Russian(outputted into the browser Console or a special div created by a browser extension) be assumed changing this page without permission from its owner?
  3. Padonak

    JavaScript How do I insert this in a Input Text

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> </head> <body> <h1>HTML Geolocation</h1> <!--p>Click the button to get your coordinates.</p--> <p id="demo" align="center"> <form id="form1" name="form1" method="post"> <h1 align="center" ><?php echo date('h:i a')...
  4. Padonak

    JavaScript Help make a clickable DIV block

    Not true. It works ok in IE, Edge, Opera and Chrome at least
  5. Padonak

    JavaScript Help make a clickable DIV block

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title></title> <style> </style> <script> </script> </head> <body> <div class="wpb_column pos-middle pos-center align_center column_child col-lg-6 col-md-33 single-internal-gutter">...
  6. Padonak

    JavaScript dynamically populating html drop down list through javascript

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title></title> <style> select{ cursor: pointer; } </style> </head> <body> <select id="inceptionDates"> <option value="">choose one</option> </select> <script> const...
  7. Padonak

    JavaScript Copy and paste of 8 Inputfields

    It's still not clear for what attribute these MO's stand for - id, name, data-smth? Do not hesitate to show markup of the page to let the others help you the right way. Would you like to copy these values automatically on the page load / or manually after doing something / or should this happen...
  8. Padonak

    JavaScript if anyone can help how to prevent duplicated data. currently it shows error msg but still inserts new row

    Try this one: <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" /> <style> td{ padding: 5px 5px; text-align: center; } .errorMsg { background-color: rgb(176, 8, 33); display: none...
  9. Padonak

    JavaScript JavaScript Hiding All Images On Page But I Need One Always Visible

    for (let i = 0; i < allImages.length; i++) { if( allImages[i].className == "flag" ) continue; else{allImages[i].className = "hide";} }
  10. Padonak

    JavaScript Retrieve and display address in address bar

    I suspect that your script is working when the span id="file" doesn't exist yet. What if you try something like this: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>ERROR 404</title> <style> body{ padding-top: 15%; text-align: center; }...
  11. Padonak

    JavaScript Enter key input result disappears

    Because the form is submitted by pressing this key. To prevent this action use the preventDefault() method : if (event.key == "Enter") { event.preventDefault(); document.getElementById("myresult").innerHTML = "You pressed the Enter key." }
  12. Padonak

    JavaScript Get the value of html element within the 'dd itemprop'

    The id property of the Element interface represents the element's identifier, reflecting the id global attribute. If the id value is not the empty string, it must be unique in a document. ( Element: id property ) So, you can not have more than one element having id="wrap" within your page.
  13. Padonak

    JavaScript Toggle four photos with a click

    <!DOCTYPE html> <html> <head> <title>Switch Images</title> <style> *{margin: 0; padding: 0; box-sizing: border-box;} p{font-size: 24px;} .wrap img{cursor: pointer;} </style> <script> const imgObj = { 'Between two images' : ['one.jpg', 'two.jpg'], /*...
  14. Padonak

    JavaScript how to get index for specific coordinate in array?

    const myArray = [[1, 2], [3, 4, 5], [6, 7, 9]], target = [6, 7, 9].join(''), index = myArray.findIndex(element => Array.isArray(element) && element.join('') === target); console.log( index ); // 2
Back
Top Bottom