troubleshooting Question

html border input line

Avatar of Whing Dela Cruz
Whing Dela CruzFlag for Anguilla asked on
7 Comments2 Solutions140 ViewsLast Modified:
Hi experts, I want to color the input(text) inside the table, on a specific row, which is only on row 2. The table below has a common input(text) on columns 1 with an id of "i75". I have a button which i want that when i click the button it will be executed. Thank you!

<!DOCTYPE html>
table {
    font-family: arial, sans-serif;
    border-collapse: collapse;
    width: 100%;

td, th {
    border: 1px solid #dddddd;
    text-align: left;
    padding: 8px;

tr:nth-child(even) {
    background-color: #dddddd;

<table id="myTable">
    <th><input type="text"  id="i75"></th>
    <td><input type="text"  id="i75"></td>
    <td>Maria Anders</td>
    <td><input type="text"  id="i75"></td>
    <td>Francisco Chang</td>

<button onclick="myFunction('2')">Click me</button>

function myFunction(x)
  document.getElementById("i75").style.border = 'solid 2px green';
Join our community to see this answer!
Unlock 2 Answers and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros