Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>EDIT: </p> <pre><code>$("#mobileBtns &gt; li:has(span:contains(TrainView))").hide(); </code></pre> <p>Change <code>TrainView</code> to whatever text you want to search for. This selects the <code>li</code> element under <code>mobileBtns</code> that has a <code>span</code> that contains the text <code>TrainView</code>. If you want a non-jquery solution let me know.</p> <pre><code>function isBrowser(browserName) { var userAgent = navigator.userAgent; for(var i = 0; i &lt; browserName.length; i++) { if(userAgent.indexOf(browserName[i]) != -1) { return true; } } return false; } if(isBrowser(["BlackBerry"])) { document.write('&lt;link rel="stylesheet" href="/m/css/mobile.css" type="text/css" /&gt;'); } else if(isBrowser(["iPhone", "Android", "Gecko", "MSIE", "Chrome", "Opera"])) { document.write('&lt;link rel="stylesheet" href="/m/css/smartmobile.css" type="text/css" /&gt;'); } else { document.write('&lt;link rel="stylesheet" href="/m/css/mobile.css" type="text/css" /&gt;'); } </code></pre> <p>EDIT: You need to wrap the <code>$(...)</code> code after the document has loaded like this:</p> <pre><code>$(document).ready(function () { $("#mobileBtns &gt; li:has(span:contains(TrainView))").hide(); }); </code></pre> <p><strong>EDIT 2</strong>: Here's a javascript funciton that doesn't use jQuery to find/hide the list item. Replace the <code>$(document).read()...</code> with this code:</p> <pre><code>function hideListItem(text) { var ul = document.getElementById("mobileBtns"); for(var i = 0; i &lt; ul.childNodes.length; i++) { var li = ul.childNodes[i]; // Element node. if (li.nodeType == 1) { // Find the text in all of the inner-html. if (li.innerHTML.indexOf(text) != -1) { li.style.display = "none"; break; } } } } window.onload = function (e) { hideListItem("Schedules"); }; </code></pre> <p><strong>EDIT 3</strong>: Ok I think <code>window.onload</code> <a href="http://supportforums.blackberry.com/t5/Web-Development/BrowserContentManager-supported-DOM-API/m-p/123558" rel="nofollow noreferrer">isn't supported in your version</a> of the browser. What you <em>can</em> do is move the JavaScript call to <code>hideListItem()</code> code <em>to the end</em> of the <code>body</code> tag:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;!-- put your hideListItem function declaration here --&gt; &lt;/head&gt; &lt;body&gt; &lt;!--...stuff here...--&gt; &lt;script type="text/javascript"&gt; hideListItem("Schedules"); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload