Get the App
SLTechnology News&Howtos  ›  Development  › 

How to implement HTML imitating Command Line Interface

Shulou Source: shulou.com Published: 2022-06-01 03:29:21 09月22日 Update

Most people do not understand the knowledge points of this article "HTML imitating command line interface", so the editor summarizes the following content, detailed content, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "HTML imitating command line interface how to achieve" article.

HTML part

Copy the code

The code is as follows:

WeChat Manager

$(document) .ready (function () {

$(document) .keyup (function (event) {

If (event.keyCode = = 13) {

$.ajax ({

Type: "POST"

Url: "ok.php"

Data: "code=" + $("# in") .val ()

Success: function (msg) {

$("ul") .append ("" + $("# in") .val () + "); / / output the input to the interface

$("ul") .append ("" + msg+ ""); / / get the return value and output

$("# in"). Val (""); / / clear the input box

$("# text") .scrollTop ($("# text") .scrollTop () + 32); / / pull the scroll bar to the bottom to display the input box

}

});

}

});

$("# in") [0] .focus ()

});

Wechat Dos

Welcome...

Login:

CSS part

Copy the code

The code is as follows:

@ charset "utf-8"

Body {

Background-color:#396DA5

Margin:0px

Padding:0px

Color:#fff

Font: Microsoft Yahei

Font-size:14px;}

.window {

Border:6px # ccc outset

Width:680px

Height:442px

Background-color:#000

Position:absolute

Top:40px

Left:68px

Overflow:hidden}

.title {

Background-color:#08246B

Padding:2px;}

# text {

Background-color:#000

Border-top:#ccc outset 2px

Height:420px

Overflow-y:scroll;}

Ul {

Margin:0px

Padding:0px

List-style:none;}

Input {

Background-color:#000

Border:0

Color:#fff

Outline:none

/ * font-size:12px;*/

Width:100%}

The above is the content of this article on "how to implement HTML imitating command line interface". I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.

Tags: Content interface code commands input articles knowledge articles parts output value most that is more steps knowledge points industry information information channels channels Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Redmi Docker MariaDB Xiaomi