Javascript : Input Type Text
- From: Deepak Goel <deepakg techxp tech>
- To: javascript-list gnome org
- Subject: Javascript : Input Type Text
- Date: Thu, 20 Jan 2022 15:41:19 +0530
Hello
I have written a small piece of _javascript_/HTML. However I cannot align the text properly in the text field. Any ideas?
==========================================================
<!DOCTYPE html>
<html>
<head>
<style>
.Large
{
border: 1px solid black;
padding: 10px;
height: 400px;
width: 400px;
text-align: left;
}
</style>
</head>
<body>
<button _onclick_="change()">Change Text</button>
<button _onclick_="change1()">Change Text</button>
<input type="text" id="my_field" maxlength="100" size="100" class="Large" value="Deepak">
<script>
function change(){
var txt = "TechXp is an Experiential Technology firm,"
+ "\n" +" focused on providing agencies and their clients with digital experiential solutions.";
document.getElementById("my_field").value = txt;
}
function change1(){
var txt = "Atlanta Estate, Off, Western Express Hwy, ITT Bhatti, Hanuman Tekdi, Goregaon, Mumbai, Maharashtra 400063";
document.getElementById("my_field").value = txt;
}
</script>
</body>
</html>
==========================================================
Thanks & Regards,
Deepak Goel
7350012833
deepakg techxp tech
Attachment:
Javascript Text Allignment.PNG
Description: PNG image
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]