“Jalankan perintah javascript” Kode Jawaban

Jalankan perintah javascript

<!DOCTYPE html>
<html>
<body onkeydown="myFunction(event)">

<h1>The Document Object</h1>
<h2>The execCommand() Method</h2>

<p>The executeCommand() method executes a specified command on selected text.</p>
<p>Select some text in this page, and press SHIFT to make the selected text toggle between bold and normal.</p>

<script>
document.designMode = "on";

function myFunction(event) {
  if (event.keyCode == 16) {
    // Execute command if user presses the SHIFT button:
    document.execCommand("bold");
  }
}

</script>

</body>
</html>
ayaan

Perintah JavaScript Run

const { execSync } = require('child_process');

const output = execSync('ls', { encoding: 'utf-8' });

console.log('The output is:');
console.log(output);
garzj

cara menjalankan perintah di prompt perintah menggunakan javascript

var objShell = new ActiveXObject("Shell.Application");
        objShell.ShellExecute("cmd.exe", "C: cd C:\\pr main.exe blablafile.txt auto", "C:\\WINDOWS\\system32", "open", "1");
//NOTE: ONLY WORKS ON WINDOWS AS I KNOW OF
Catking The Cat That Has An Extremely Long Username

Jawaban yang mirip dengan “Jalankan perintah javascript”

Pertanyaan yang mirip dengan “Jalankan perintah javascript”

Lebih banyak jawaban terkait untuk “Jalankan perintah javascript” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya