如何通过单击按钮在HTML文本框中自动生成序列号

时间:2016-09-26 06:17:07

标签: javascript html

如何通过单击按钮在HTML文本框中自动生成序列号。

enter image description here

1 个答案:

答案 0 :(得分:1)

struct SomePost: Post {
    var referenceIndex: Int
    var likeCount: Int
    var likeStatus: Bool
    var commentCount: Int
    var commentStatus: Bool
}

let somePost1 = SomePost(referenceIndex: 1, likeCount: 1, likeStatus: true, commentCount: 1, commentStatus: true)
let somePost2 = SomePost(referenceIndex: 2, likeCount: 1, likeStatus: true, commentCount: 1, commentStatus: true)
let somePost3 = SomePost(referenceIndex: 1, likeCount: 1, likeStatus: true, commentCount: 1, commentStatus: true)

somePost1 == somePost2 //false
somePost1 == somePost3 //true