Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize static search function in jquery

2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Today, the editor will share with you the relevant knowledge points about how to achieve static search function in jquery. The content is detailed and the logic is clear. I believe most people still know too much about this, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.

Effect picture:

The code is as follows:

Jquery implements the static search function. Navbar-collapse {padding: 0;} .alert {margin: 20px;} .input-group select.form-control:last-child {border-top-left-radius: 4px; border-bottom-left-radius: 4px; margin-right:-1px;} .tab-content {padding-top: 20px;}

Cleveland Cavaliers Golden State Warriors Boston Celtics Houston Rockets search results tab hide all names location introduction search number name location height weight introduction 23 LeBron-Jaime S small forward 203CM 113KG four-time NBA most valuable player Award 2 Kyle Irving point guard 191CM 88KG 15-16 season NBA championship 0 Kevin Love power forward / center 208CM 110KG 15-16 season won NBA championship 13 Tristan Thompson power forward 206CM 103KG is good at rebounding 5 J.R. Smith shooting guard 198CM 102KG 15-16 season NBA championship number, name, height and weight introduction 30 Stephen Curry point guard 191CM 83.9KG two-time NBA most valuable player award three points accurate 11 Clay Thompson point guard 201CM 93KG 14- 15 season NBA champion 35 Kevin Durant small forward / power forward 211CM 106.6KG scores multiple shots 23 Draymond Green forward 201CM 104KG top forward defender 9 Andrew Iguodala shooting guard 198CM 94KG Mini LeBron excellent physical fitness number Name position height weight introduction 4 Isaiah Thomas point guard 175CM 84KG strong style can break through the three-point range 0 Avery Bradley point guard 188CM 82KG 15-16 season best defensive lineup first line-up 42 Al-Horford center 208CM 111KG Ball style comprehensive inside distance accurate 9 Jay Crowder power forward 198CM 107KG energetic dual energy forward 36 Marcus Smart point guard 193CM 100KG dare to break through the body against the ball style selfless number name position height and weight introduction 13 Jaime S-Harden guard 196CM 99.8KG was twice selected in the NBA Best team 1 Trevor Ariza small forward 203CM 95.3KG 08-09 season NBA championship 2 Patrick Beverly point guard 185CM 84KG 2015 all-Star skills Challenge champion 10 Eric Gordon shooting guard 191CM 100.7KG It belongs to attacking shooting guard 3 Ryan Anderson power forward 208CM 109KG shooting inside shot quick search result number name position height weight introduction

The information is extracted from the Internet. If there is any offense, please forgive me. Please leave a message and delete it immediately.

$('# myTabs a') .click (function (e) {e.preventDefault () $(this) .tab ('show')}) $(' # searchText') .change (function () {console.log ("dd"); var searchText = $(this). Val (); var searchSelect = $('# searchSelect'). Val (); var $searchTr = "; if (searchText! =") {$('# search tbody'). Html (") / / filter search if (searchSelect = = "name") {$searchTr = $('# myTabContent'). Find ('td:nth-child (2): contains (' + searchText +')'). Parent ();} else if (searchSelect = = "position") {$searchTr = $('# myTabContent'). Find ('td:nth-child (3): contains (' + searchText +')'). Parent () } else if (searchSelect = = "about") {$searchTr = $('# myTabContent'). Find ('td:nth-child (6): contains (' + searchText +')'). Parent ();} else {$searchTr = $('# myTabContent'). Find ('td:contains (' + searchText +')'). Parent ();} $searchTr.each (function (I, e) {$('# search tbody'). Append ($(e) .clone (true);}) / / if no search results show an error div if ($searchTr.length)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report