#Index.Html
<title>Document</title> <style> table { width: 90%; margin:auto ; height: 33rem; text-align : center; font-size: large; background:#f9c3d6; padding: 1px; color:black; border: 2px solid blue; } h1{ text-align: center; } .eee{ display: none; } button{ text-align: center; justify-content: space-between; width: 10rem; height: 2rem; background-color:deepskyblue; cursor: pointer; }.btn1{
margin-left: 32rem;
margin-top: 1rem;
}
<tr>
<td>Aryan </td>
<td> 20145 </td>
<td> Lucknow </td>
<td> Programmer </td>
<td>
<input type="text" id="emp2" class="emp" />
</td>
</tr>
<tr>
<td>Pushpam</td>
<td>20132</td>
<td>Madhubani</td>
<td>Analyst</td>
<td>
<input type="text" id="emp3" class="emp" />
</td>
</tr>
<tr>
<td> Sachin </td>
<td>20564</td>
<td> Gaya </td>
<td> Coder </td>
<td>
<input type="text" id="emp4" class="emp" />
</td>
</tr>
<tr>
<td> Anand </td>
<td>20558</td>
<td> Chhapra </td>
<td> Developer </td>
<td>
<input type="text" id="emp5" class="emp" />
</td>
</tr>
<tr>
<td> Pushpdip </td>
<td>20149</td>
<td> Bihar </td>
<td> Coder </td>
<td>
<input type="text" id="emp6" class="emp" />
</td>
</tr>
</tbody>
</table>
<button class="btn1" onclick="show()">show</button>
<!-- <button class="btn2" onclick="hide()">Hide</button> -->
<button class="btn1" onclick="tsalar()">Total Sallary</button>
<!-- <h1><input type="number" id="totalsalary"/> </h1> -->
#Index.js const fs = require('fs').promises; const fs1 = require('fs'); const http = require('http');
async function readFile(filePath){ try{ const data = await fs.readFile(filePath); console.log(data.toString()); const data1 = data.toString();
fs.writeFile('newFile.html', data1)
}catch(error){
console.log("Error", error, "in file ", filePath );
}
} readFile('index.html'); http.createServer(function (req, res){ fs1.readFile('newFile.html', function(err, data) { if (err) { res.writeHead(404); console.error('Error reading HTML file:', err); res.end(); } else { res.writeHead(200, {'Content-type': 'text/html'}) res.write(data); res.write("
"); } });}).listen(8080);
| Name | UID | City | Job role | Salary |
|---|---|---|---|---|
| Navneet | 20149 | Bettiah | Developer |