Add Copy Timestamp
A button that will copy the current timestamp has been added.
This commit is contained in:
11
clock.js
11
clock.js
@@ -46,3 +46,14 @@ function startTime(){
|
||||
}
|
||||
//document.getElementById('JStz').innerHTML = current_tz;
|
||||
}
|
||||
|
||||
function copy_timestamp() {
|
||||
var copyText = document.getElementById("time_body").innerText;
|
||||
var temp_element = document.createElement("textarea");
|
||||
document.body.appendChild(temp_element)
|
||||
temp_element.value = copyText;
|
||||
temp_element.select();
|
||||
temp_element.setSelectionRange(0,999);
|
||||
document.execCommand("copy");
|
||||
document.body.removeChild(temp_element);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user