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
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?
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...
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;
}...
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."
}
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.
Well, I was wrong about variable scope. You are posting code without using the </> tag, which makes it dificult to inspect. Please, don't hesitate to use this tag in your future posts. Greetings from Russia.
Hi there, Anish ) There is one thing I didn't notice from the very first sight. You are trying to access a local scope variable(declared within the function block of code) from outside this function. There are two ways to solve it:
declare this variable on the top level(outside the function)...
document.querySelectorAll not single element but the whole collection returned and you can not set it's innerHTML
what elements match this selector? is this a tag name or a class name? class name must be started with dot like ('.first_autocomplete_box')