Click here to Skip to main content
12,756,705 members (31,663 online)
Click here to Skip to main content
Add your own
alternative version


7 bookmarked
Posted 4 Apr 2013

JavaScript for Bookmark Login

, 1 Oct 2013 CPOL
Rate this:
Please Sign up or sign in to vote.
Use this script to create Bookmarks that enable quick Login to your favourite sites.


This code has been designed to list all the Tags on a web page that have an Id and then allow the user to select that element and enter a value that should be inserted into that element's value. A JavaScript is then generated that can be pasted in to a bookmark URL to enable one click entry in to most websites. Starting with a basic single entry code for updating the Username / ID, I have updated the code to allow multiple Input field updating and drilling down two layers of iFrame. Tested on the Pizza Express Voucher entry field, I felt this addition to be of some benefit.


As a lot of my time between contracts is spent job searching, I visit a lot of Job Search web sites. Some of my contracts span over 2 to 3 years and trying to remember all the Login Ids for all the websites can be a bit mind blowing.

In my recent job search activity, I have tried to protect my own software developments by limiting my PC's Internet presence and opting for the use of my iPhone and or iPad, with the occasional need of my Nokia N810 whenever a non image file needs to be uploaded.

Using the Code

I have added another prompt function to give you the chance to search elements by Name where forms are concerned. Also added the function top pre-populate the Enter Value prompt with the value already in the element. The code below can be pasted into a browser bookmark using the following method:

  • Create a bookmark to this page and give it a title like Login Script.
  • Save the bookmark to where you feel it will be quickly accessed.
  • Copy the script below.
  • Edit the bookmark Login Script and delete the URL, then paste in the copied script.
  • Click Done to finish editing and Save the bookmark.
  • Go to the Login page of any website and click the Login Script bookmark (it usually makes it easier to identify the desired input box by entering some text, i.e., 'aa').
  • A prompt box will list all the Elements on that page that have an ID and if you have entered some text, that text will also be shown as the value.
  • Enter the Number displayed for that element in the input field.
  • If the element you select is an iFrame, the code will then generate another list of elements within that iFrame. This code will allow you to go as deep as an iFrame within another iFrame. You should ensure to update all the Elements on the upper layers before drilling down in to any iFrames.
  • A second input box will request the value you wish to assign to that element and you can enter anything such as an Email Address.
  • A third input box will ask you if you wish to update any other elements within the layer you are in. The code allows for anything up to 77 elements.
  • The last input box will give you the script you need. SelectAll and Copy the script given.
  • Finally, create two bookmarks to the Login Page you are on and give the Second Title an ending of ID
  • Edit the ID bookmark and replace the URL with the generated script you copied from the Prompt Box.
    var a,b,c,d,e="",f,g="",h,i,j,k,l;
        j=prompt("Please choose the element ID type, 1='id', 2='name'!","1");
            d=prompt("Please give me the value for "+a[c].id+"!",a[c].value);
        else {
            d=prompt("Please give me the value for "+a[c].name+"!",a[c].value);
            if(prompt("Update another Element in this selection?  
            Y=Yes, N=No!","n").toLowerCase()=="n"){
                prompt("Use this script!","javascript:"+g+"Return;");
function fndEl(a){
    for(i=0;i<a.length;i++){ if(j="=1){k=a[i].id;}" 
    {k="a[i].name;}" if(!k||k="=""){}" b="b+i+")" "+k+"="+a[i].value+" c="-1;" 
    {" j="prompt("Please" 1="id" 2="name" 
    e="document.getElementById('" a="a[c].contentWindow.document.getElementsByTagName('*');" 


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

IPI Paul
Software Developer (Junior)
United Kingdom United Kingdom
Developed my 1st Accounts Database in 1994 using Lotus 123. Following that, a Payroll Database in 1999 using Microsoft Access 1997. I then went on to developing my 1st intergrated Multi Currency and Multi Department Accounts and Payroll database in 2002 using Microsoft Access 2000 then upgraded it to 2003.

I have been sharing Microsfot Software Solutions on the web since 1999. In trying to improve the quality of my work, I have studied Microsoft Office packages from 95 to 2013, Microsoft SQL Server version 7 to 2012 Dev, MySQL, PHP, C++, visual Basic 6, HTML, CSS, XML, Vbscript, JavaScript, DOS, IIS version 4 to 7 and all Microsoft Client and Server Operating Systems from Windows 95 to Windows 8 Pro.

My aim is to learn and utilize everything that makes an office run smoothly.

Vbscript, SQL Script, JavaScript, Visual Basic Macros, Microsoft Excel and Access Macros, Stored Procedures, C# for Asp.Net, SSRS.

You may also be interested in...


Comments and Discussions

GeneralThanks Pin
IPI Paul2-Oct-13 11:12
memberIPI Paul2-Oct-13 11:12 
GeneralGreat post Pin
pavanbhardwaj872-Oct-13 1:09
memberpavanbhardwaj872-Oct-13 1:09 
GeneralUsefull Pin
HarryBauer2471-Oct-13 23:45
memberHarryBauer2471-Oct-13 23:45 
SuggestionDevelopment Pin
IPI Paul5-Apr-13 10:17
memberIPI Paul5-Apr-13 10:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170217.1 | Last Updated 1 Oct 2013
Article Copyright 2013 by IPI Paul
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid