0

I have a input tag with this css.

#myInput {
  position: relative;
  border: 1px solid #95B8E7;
  background-color: #fff;
  height: 30px;
  vertical-align: middle;
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  margin: 0;
  padding: 0;
  -moz-border-radius: 5px 5px 5px 5px;
  -webkit-border-radius: 5px 5px 5px 5px;
  border-radius: 5px 5px 5px 5px;
}

I wanted my Input field value should be underline and ';' at the end. How should I write CSS for that.

Here is I am setting my input Value.

function selectItem(input, value) {
        input.value += " "+value+";";

    }
2
  • text-decoration: underline Commented Jun 20, 2017 at 14:33
  • This is partially correct but how to apply in my code Commented Jun 20, 2017 at 14:36

1 Answer 1

1

Add text-decoration: underline; to your CSS, and just call your function by selecting your HTML element, like so: selectItem(document.getElementById('myInput'),'foo').

Working Jsfiddle: https://jsfiddle.net/tacj0eeq/2/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.